Hi all,
I am trying to compile and build SFML 2.5.1 on Windows 10 and include it with a VS project to brush up on my skills. I am having trouble trying to track down why I am getting this linker error in visual studio. I believe I have compiled and built the source code properly using cmake and visual studio. I have added the libraries to the Linker>Input>Additional Dependencies project properties. I have added the include directory under VC++ Directories>Include Directories project properties. I have added the library directory under VC++>Library Directories project properties.
*edit: Maybe it has to do with the dynamic libraries instead of the static ones? Or does it have to do with not linking the libraries and includes in the c++ and linker project properties versus the VC++ properties?
As I'm investigating I'm thinking it has to do with the DLL's, but I could be on the wrong trail.
Any help would be much appreciated.
1>------ Build started: Project: sfmltest, Configuration: Debug x64 ------
1>Build started 5/13/2020 6:51:43 PM.
1>Target InitializeBuildStatus:
1> Touching "x64\Debug\sfmltest.tlog\unsuccessfulbuild".
1>Target ClCompile:
1> All outputs are up-to-date.
1> sfml_app.cpp
1>Target Link:
1> Searching libraries
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-audio-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-graphics-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-main-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-network-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-system-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-window-d.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\kernel32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\user32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\gdi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\winspool.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\comdlg32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\advapi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\shell32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\ole32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\oleaut32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\uuid.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbc32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbccp32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\vcruntimed.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64\ucrtd.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-audio-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-graphics-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-main-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-network-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-system-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-window-d.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\kernel32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\user32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\gdi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\winspool.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\comdlg32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\advapi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\shell32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\ole32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\oleaut32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\uuid.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbc32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbccp32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\vcruntimed.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64\ucrtd.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-audio-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-graphics-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-main-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-network-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-system-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-window-d.lib:
1>
1> Finished searching libraries
1>
1> Searching libraries
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-audio-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-graphics-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-main-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-network-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-system-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-window-d.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\kernel32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\user32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\gdi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\winspool.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\comdlg32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\advapi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\shell32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\ole32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\oleaut32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\uuid.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbc32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbccp32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\vcruntimed.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64\ucrtd.lib:
1>
1> Finished searching libraries
1>
1> Searching libraries
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-audio-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-graphics-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-main-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-network-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-system-d.lib:
1> Searching C:\Users\Javier\Downloads\Programs\sfml-build64\lib\Debug\sfml-window-d.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\kernel32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\user32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\gdi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\winspool.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\comdlg32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\advapi32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\shell32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\ole32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\oleaut32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\uuid.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbc32.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64\odbccp32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\OLDNAMES.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\lib\x64\vcruntimed.lib:
1> Searching C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64\ucrtd.lib:
1>
1> Finished searching libraries
1> sfml_app.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1> sfml_app.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1> C:\Users\Javier\Development\sfmltest\x64\Debug\sfmltest.exe : fatal error LNK1120: 2 unresolved externals
1>Done building target "Link" in project "sfmltest.vcxproj" -- FAILED.
1>
1>Done building project "sfmltest.vcxproj" -- FAILED.
1>
1>Build FAILED.
1>
1>sfml_app.obj : error LNK2001: unresolved external symbol "public: static class sf::RenderStates const sf::RenderStates::Default" (?Default@RenderStates@sf@@2V12@B)
1>sfml_app.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B)
1>C:\Users\Javier\Development\sfmltest\x64\Debug\sfmltest.exe : fatal error LNK1120: 2 unresolved externals
1> 0 Warning(s)
1> 3 Error(s)
1>
1>Time Elapsed 00:00:01.09
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========