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

Author Topic: Can't resolve LNK2001 "unresolved symbol"  (Read 904 times)

0 Members and 1 Guest are viewing this topic.

Spritehero

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Can't resolve LNK2001 "unresolved symbol"
« on: January 28, 2024, 02:29:03 am »
Hi!

I am trying to build a project statically, but I cant solve this issue. I wrote SFML_STATIC in preprocessor, I tried to change MD, MT, tried to understand the LNK2001 error documentation but I am giving up and asking for help.

Errors are like:

Error   LNK2001   unresolved external symbol FT_Init_FreeType   
Error   LNK2001   unresolved external symbol __imp_wglCreateContext

Most of the issues are with Font.obj, and a few also with WglContext, JoyStickImpl.

Thank you for any advice or help in advance, sorry if I missed something foundamental so  it can work.   

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: Can't resolve LNK2001 "unresolved symbol"
« Reply #1 on: January 28, 2024, 03:56:15 am »
When SFML is linked statically, you have to manually link in all of the dependency libraries.
In your case it looks like you haven't added opengl32 and freetype as addition libraries.

There's a table of what you need to link here: https://www.sfml-dev.org/tutorials/2.5/start-cb.php (around half way down).

Spritehero

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Can't resolve LNK2001 "unresolved symbol"
« Reply #2 on: January 28, 2024, 01:24:00 pm »
Thank you very much, you were completely right, I included all dependencies and it works flawlessly!