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

Author Topic: LNK2019 unresolved external symbol....  (Read 1882 times)

0 Members and 1 Guest are viewing this topic.

andrei186

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • Email
LNK2019 unresolved external symbol....
« on: September 30, 2019, 04:52:12 pm »
Hi, colleagues,
Four year ago there was a thread here  "Unresolved External Symbol" (https://en.sfml-dev.org/forums/index.php?topic=14715.0) which remains unresolved.

Trying to set up Visual Studio 2015 to work with SFML I run into  similar problem

In my 64 bit  Win 7 ultimate SP 1 I have: 

Visual Studio Community 2015   Version 14.0.25431.01 update 3.
It does not say if it is 86 or 64 but was installed from
en_visual_studio_community_2015_with_update_3_x86_x64_web_installer_8922963.exe
and says that it includes Visual C++ 2015 00322 20000 00000 AA787

SFML 2.5.1 for  Visual C++ 14 (2015) - 64-bit   downloaded from  www.sfml-dev.org/download/sfml/2.5.1/

I did and checked twice all the settings for the static version as prescribed at www.sfml-dev.org/tutorials/2.5/start-vc.php
I set Debug and Release for x64

Yet the sample code shown at www.sfml-dev.org/tutorials/2.5/start-vc.php  returns a bunch of errors "LNK2019 unresolved external symbol....." all referring to the first line of the code which is
#include <SFML/Graphics.hpp> 
and blaming symbols like gkBlendFunc, glClearColor etc from files sfml-graphics-s-d.lib, sfml-window-s-d.lib and sfml-system-s-d.lib,

Obviously VS finds and opens necessary libraries yet does not understand them.

In that old thread mentioned one of the suspects was C++ compiler which in VS10 was 32bit

How shall I find out if C++ compiler  in my  VS-2015 is 32 or 64?
if it is 64 what could be other possible reasons for errors?
Do I have incompatible version of VS and SFML? Or my setting in VS are wrong?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: LNK2019 unresolved external symbol....
« Reply #1 on: October 03, 2019, 12:05:50 am »
Yet the sample code shown at www.sfml-dev.org/tutorials/2.5/start-vc.php  returns a bunch of errors "LNK2019 unresolved external symbol....." all referring to the first line of the code which is
#include <SFML/Graphics.hpp> 
and blaming symbols like gkBlendFunc, glClearColor etc from files sfml-graphics-s-d.lib, sfml-window-s-d.lib and sfml-system-s-d.lib,
glBlendFunc and glClearColor and part of OpenGL, which tells me you're not linking opengl32.lib for your given configuration.
Make sure you've set the compiler to x64 and that on the Debug and Release configuration you've linked against OpenGL. :)

As a general tip for technical questions, always include the complete or if too long an excerpt from the original error message. The message may not tell you anything useful, but they usually contain vital information on the problem and will help someone experienced enough to help you get on the right track in fixing an issue. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/