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

Author Topic: SFML 2.6 Unresolved external symbol  (Read 1562 times)

0 Members and 2 Guests are viewing this topic.

Dolotboy

  • Newbie
  • *
  • Posts: 8
    • View Profile
SFML 2.6 Unresolved external symbol
« on: August 21, 2023, 06:01:11 pm »
Hi, I added SFML 2.6 to my project, I followed the documentations https://www.sfml-dev.org/tutorials/2.6/start-vc.php but I still get 17 errors saying "unresolved external symbol" i've tried everything but nothing seems to be working. Here is what I added to Debug and Release

Debug:
sfml-graphics-s-d.lib
sfml-audio-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
opengl32.lib
winmm.lib
gdi32.lib
ws2_32.lib


Release:
sfml-graphics-s.lib
sfml-audio-s.lib
sfml-window-s.lib
sfml-system-s.lib
opengl32.lib
winmm.lib
gdi32.lib
ws2_32.lib

I followed step by step the tutorial, even tried the part where they talk about SFML_STATIC, but it didn't change anything, here is the example of error I get:

Error   LNK2019   unresolved external symbol "public: __thiscall sf::String::String(char const *,class std::locale const &)" (??0String@sf@@QAE@PBDABVlocale@std@@@Z) referenced in function _main   GameEngine   E:\Programmation\Apps\GameEngine\GameEngine\main.obj   1

Error   LNK2019   unresolved external symbol "public: __thiscall sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (??0VideoMode@sf@@QAE@III@Z) referenced in function _main   GameEngine   E:\Programmation\Apps\GameEngine\GameEngine\main.obj   1   

Error   LNK2019   unresolved external symbol "public: __thiscall sf::Color::Color(unsigned char,unsigned char,unsigned char,unsigned char)" (??0Color@sf@@QAE@EEEE@Z) referenced in function _main   GameEngine   E:\Programmation\Apps\GameEngine\GameEngine\main.obj   1   

... and 14 more for Video::Video, Window::Window etc... Can you help me ?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML 2.6 Unresolved external symbol
« Reply #1 on: August 21, 2023, 06:20:03 pm »
If you're linking statically then definitely define SFML_STATIC.

You should also link all of the dependencies of all modules (as noted in the red box just above the dependencies table). I notice you're missing one from Graphics and plenty from Audio.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Dolotboy

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: SFML 2.6 Unresolved external symbol
« Reply #2 on: August 21, 2023, 06:58:07 pm »
If you're linking statically then definitely define SFML_STATIC.

You should also link all of the dependencies of all modules (as noted in the red box just above the dependencies table). I notice you're missing one from Graphics and plenty from Audio.

I verified and in C/C++ -> Preprocessor of Debug and Release "SFML_STATIC" was already added and now I link all these lib

Debug:
sfml-graphics-s-d.lib
sfml-audio-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib
opengl32.lib
winmm.lib
gdi32.lib
ws2_32.lib
freetype.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

Release:
sfml-graphics-s.lib
sfml-audio-s.lib
sfml-window-s.lib
sfml-system-s.lib
opengl32.lib
winmm.lib
gdi32.lib
ws2_32.lib
freetype.lib
openal32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib

But when I try to compile, I still get the same errors...

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML 2.6 Unresolved external symbol
« Reply #3 on: August 21, 2023, 07:06:03 pm »
Did you build SFML yourself?

These errors look - to me - like they are linking to a library that is built with a different compiler. Or a 32-bit/64-bit mismatch.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Dolotboy

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: SFML 2.6 Unresolved external symbol
« Reply #4 on: August 21, 2023, 07:27:12 pm »
Did you build SFML yourself?

These errors look - to me - like they are linking to a library that is built with a different compiler. Or a 32-bit/64-bit mismatch.

Well I downloaded it there https://www.sfml-dev.org/download/sfml/2.6.0/ I put it on my "D:" and followed the tutorial

Dolotboy

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: SFML 2.6 Unresolved external symbol
« Reply #5 on: August 21, 2023, 10:53:02 pm »
SOLVED:

Configuration were for x86 (32 bits) but I downloaded 64 bits version

 

anything