Hello there !
I've just recently tried SFML and have bumped into a little
of a problem. SFML is working fine with simple programs
and there's no problem creating a CircleShape and moving
it around with the keyboard using events.
When I tried replacing CircleShape with Sprite and Texture
this line:
if(!PlayerTexture.loadFromFile("res/player.png"))
makes the linker complain as such:
||=== Build: Release in sfmltst01 (compiler: GNU GCC Compiler) ===|
obj\Release\sfmltst01.o:sfmltst01.cpp|| undefined reference to `sf::Texture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sf::Rect<int> const&)'|
||error: ld returned 1 exit status|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|
I did look at the tutorial page (
http://www.sfml-dev.org/tutorials/2.3/start-cb.php)
and set up to linking the SFML libraries statically (SFML_STATIC is defined):
C:\Development\SFML-2.3.2\lib\libsfml-graphics-s.a
C:\Development\SFML-2.3.2\lib\libfreetype.a
C:\Development\SFML-2.3.2\lib\libjpeg.a
C:\Development\SFML-2.3.2\lib\libsfml-windows-s.a
C:\Development\TDM-GCC-5.1.0-3\lib\libopengl32.a
C:\Development\TDM-GCC-5.1.0-3\lib\libgdi32.a
C:\Development\SFML-2.3.2\lib\libsfml-system-s.a
C:\Development\TDM-GCC-5.1.0-3\lib\libwinmm.a
I've tried messing with the linking order and #including
a bunch of files but I've not managed to solve it.
Using Code::Blocks 16.01 with TDM-GCC 5.1.0-3 and
SFML 2.3.2 GCC 4.8.1 TDM (SJLJ) - 32-bit on Windows.
Any help for what probably is just a beginners error
is greatly appreciated, thanks for reading =)