SFML community forums

Help => General => Topic started by: nyam on June 29, 2014, 02:00:02 pm

Title: LNK2001: unresolved external symbol
Post by: nyam on June 29, 2014, 02:00:02 pm
Hello, I am newbie :D I just installed SFML and trying to run the tutorial. I got up to the http://www.sfml-dev.org/tutorials/2.1/start-vc.php (http://www.sfml-dev.org/tutorials/2.1/start-vc.php) section and I got error message. I just copied directly from tutorial. Here's error message I got:

1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>main.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
 
 

    I just zipped this whole project and ran the same project on my friend's computer. and it works well without any error message.

    Does anybody know what I did wrong?
Title: Re: LNK2001: unresolved external symbol
Post by: Hapax on June 29, 2014, 02:43:46 pm
If the program works on someone else's computer but not yours, it's not the program that has the error; it must be with your setup.
I'd suggest making sure you're linking SFML correctly (includes, libs, DLLs), and make sure you use the correct version for your version of Visual Studio. That said, which version are you using?
Title: Re: LNK2001: unresolved external symbol
Post by: nyam on June 29, 2014, 03:56:28 pm
well... I use Visual Studio 2010, and I downloaded SFML 2.1 for Visual C++ 10 (2010) at this URL : http://www.sfml-dev.org/download/sfml/2.1/ (http://www.sfml-dev.org/download/sfml/2.1/).

Before I post this question, I already download and setup again with that file, but the same error occurred.
Title: Re: LNK2001: unresolved external symbol
Post by: Hapax on June 29, 2014, 04:01:42 pm
Are you trying to link statically? If you are statically linking, you should be using the SFML libraries with the suffix -s and if you definitely not linking statically, you should be using the libraries without that suffix.
Title: Re: LNK2001: unresolved external symbol
Post by: nyam on June 29, 2014, 04:50:13 pm
OH!!!!!! Thank you T.T

Now It works. I just linked libraries statically ;;