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

Author Topic: Unresolved external symbol when statically linking  (Read 1286 times)

0 Members and 1 Guest are viewing this topic.

KiRtAp2

  • Newbie
  • *
  • Posts: 2
    • View Profile
Unresolved external symbol when statically linking
« on: February 10, 2019, 03:53:33 pm »
Hello,

I've been looking around for a solution to this for several hours now and nothing I find has worked so far.
I'm trying to compile a program in Visual Studio 2017. Compilation works fine, but I get the following linker error:
(click to show/hide)
VS says it happens in sfml-graphics-s.lib. These are my additional dependencies:
(click to show/hide)
I've configured the path to all these files, except opengl32.lib, winmm.lib, gdi32.lib (which windows should have by default). I'm pretty certain they're all readable by the linker though, because it complains differently if I move one.

I only use <SFML/Graphics.hpp> if that helps.

I've tried dynamic linking, which builds just fine, but the program crashes quite quickly after launch, even though I have provided it all the .dll files (it doesn't complain about not having them).
I'd much rather have a statically linked binary, although I'll survive with a dynamically linked one if it works properly.

Thank you for your help

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Unresolved external symbol when statically linking
« Reply #1 on: February 10, 2019, 03:57:58 pm »
Update Visual Studio to the latest/newer version. ;)

(see here or here)
« Last Edit: February 10, 2019, 04:08:48 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

KiRtAp2

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Unresolved external symbol when statically linking
« Reply #2 on: February 10, 2019, 05:03:40 pm »
Thank you, that helped! :)