SFML community forums
Help => Graphics => Topic started by: strongdrink on December 16, 2011, 05:23:21 am
-
Hello all
I just pulled from github, and when I compile I get the following error
undefined reference to sf::RenderWindow::RenderWindow(sf::VideoMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, sf::ContextSettings const&)
My code is as so
sf::RenderWindow window(sf::VideoMode(640, 480), "Name");
tx
-
Do you link to sfml-graphics?
-
g++ obj/badguy.o obj/player.o obj/main.o -lsfml-system -lsfml-network -lsfml-window -lsfml-graphics -o bin/hungrybubble
-
bump
-
Im pretty sure when you link the lib files you have to do them in reverse order of dependency.
So it would be: -lsfml-network -lsfml-graphics -lsfml-window -lsfml-system
-
No dice...
-
I just fetched the git source today, and still no luck.. I am on Arch Linux, if that helps...
-
Look, no one is answering since they don't know. You are not giving us enough information to work on. Your doing something wrong as this is a linkage failure.
What version of SFML are you using? (I guess SFML 2.0?) Do you follow the tutorials? And do you get more linkage errors if you try to use code that is in another module will you also get reference errors there? Have you tried a complete clean rebuild(remove anything that has to do with SFML from the computer and do everything again from scratch)?
And don't remember, but do you still have to define SFML_DYNAMIC for SFML2 on Linux?
Plus you would have gotten your answer much faster if you would just have searched the forum as thousands topics is just about this.
-
And also make sure that you're not linking to an old SFML 1.6.
-
This has been fixed after another full rebuild of SFML.. thanks