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

Author Topic: Fatal Error LNK 2001  (Read 1699 times)

0 Members and 1 Guest are viewing this topic.

Taco Sniper

  • Newbie
  • *
  • Posts: 6
    • View Profile
Fatal Error LNK 2001
« on: March 22, 2014, 03:43:11 am »
Hey there,
I recently moved from SFML-1.6 to SFML-2.1, and have encountered error 2001. The full error is:
1>VisibleGameObject.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VisibleGameObject::Draw(class sf::RenderWindow &)" (?Draw@VisibleGameObject@@UAEXAAVRenderWindow@sf@@@Z)
1>VisibleGameObject.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall VisibleGameObject::SetPosition(float,float)" (?SetPosition@VisibleGameObject@@UAEXMM@Z)
I have never encountered this error before, and after much Google-ing, I have found nothing to resolve it. Thus I came here to see if the SFML community is able to help.
Thanks in advance,
-TacoSniper-

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10848
    • View Profile
    • development blog
    • Email
Re: Fatal Error LNK 2001
« Reply #1 on: March 22, 2014, 10:03:39 am »
It simply means that the linker couldn't find the implementation of these two functions. Did you change the naming convention to camleCase as well (i.e. draw() and setPosition())?

Also the class keyword should not be needed.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Taco Sniper

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Fatal Error LNK 2001
« Reply #2 on: March 22, 2014, 11:44:08 am »
Hi,
Thanks man, but what solved that problem was removing virtual from in front of both functions, but now it says that:
"The program can't start because sfml-system-d-2.dll is missing from your computer. Try reinstalling the program to fix this problem."
I have searched the SFML-2.1 file and have found it in the bin file, but how to I get the IDE to find/include it when compiling??
Thanks,
-TacoSniper-
« Last Edit: March 22, 2014, 11:54:05 am by Taco Sniper »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10848
    • View Profile
    • development blog
    • Email
Re: Fatal Error LNK 2001
« Reply #3 on: March 22, 2014, 12:07:42 pm »
The DLLs are needed at runtime not compile time. Reading the tutorial might help:

Quote from: Tutorial
Now compile the project, and if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Taco Sniper

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Fatal Error LNK 2001
« Reply #4 on: March 22, 2014, 12:48:13 pm »
To you sir, I tip my hat,
Thanks man that fixed it and it runs perfectly now,
A very grateful,
-TacoSniper-

 

anything