Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Pzc

Pages: [1]
1
Graphics / Undefined reference sf::Texture::loadFromFile
« on: February 12, 2016, 09:44:09 pm »
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:
Quote
||=== 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):
(click to show/hide)

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 =)

Pages: [1]
anything