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

Author Topic: LNK2001: unresolved external symbol  (Read 3346 times)

0 Members and 1 Guest are viewing this topic.

nyam

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
LNK2001: unresolved external symbol
« 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 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?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: LNK2001: unresolved external symbol
« Reply #1 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?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

nyam

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: LNK2001: unresolved external symbol
« Reply #2 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/.

Before I post this question, I already download and setup again with that file, but the same error occurred.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: LNK2001: unresolved external symbol
« Reply #3 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.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

nyam

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: LNK2001: unresolved external symbol
« Reply #4 on: June 29, 2014, 04:50:13 pm »
OH!!!!!! Thank you T.T

Now It works. I just linked libraries statically ;;

 

anything