I've been looking through threads for a few hours now trying to find a solution to my problem, but nothing I'm finding appears to be my issue.
Anyways, I'm using MS Visual Studio 2012 with SFML 2.0 and I am trying to statically link the libraries. The errors I am getting are:
Error 1 error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::locale const &)" (??0String@sf@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVlocale@3@@Z) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 2 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 N:\Projects\C++\RTS\RTS\main.obj RTS
Error 3 error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::create(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (?create@Window@sf@@QAEXVVideoMode@2@ABVString@2@IABUContextSettings@2@@Z) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 4 error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::close(void)" (?close@Window@sf@@QAEXXZ) referenced in function "void __cdecl getEvents(void)" (?getEvents@@YAXXZ) N:\Projects\C++\RTS\RTS\main.obj RTS
Error 5 error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 6 error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function "void __cdecl getEvents(void)" (?getEvents@@YAXXZ) N:\Projects\C++\RTS\RTS\main.obj RTS
Error 7 error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(void)" (??0RenderWindow@sf@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'app''(void)" (??__Eapp@@YAXXZ) N:\Projects\C++\RTS\RTS\main.obj RTS
Error 8 error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'app''(void)" (??__Fapp@@YAXXZ) N:\Projects\C++\RTS\RTS\main.obj RTS
Error 9 error LNK2019: unresolved external symbol "void __cdecl getInputs(void)" (?getInputs@@YAXXZ) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 10 error LNK2019: unresolved external symbol "void __cdecl tick(void)" (?tick@@YAXXZ) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 11 error LNK2019: unresolved external symbol "void __cdecl updateScreen(void)" (?updateScreen@@YAXXZ) referenced in function _main N:\Projects\C++\RTS\RTS\main.obj RTS
Error 12 error LNK1120: 11 unresolved externals N:\Projects\C++\RTS\Debug\RTS.exe RTS
Also, some of my output I got during compilation:
1> Unused libraries:
1> N:\Projects\C++\RTS\RTS\libs\SFML\sfml-graphics-s-d.lib
1> N:\Projects\C++\RTS\RTS\libs\SFML\sfml-window-s-d.lib
1> N:\Projects\C++\RTS\RTS\libs\SFML\sfml-system-s-d.lib
1>
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::String::String(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::locale const &)" (??0String@sf@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVlocale@3@@Z) referenced in function _main
1>main.obj : 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
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::create(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (?create@Window@sf@@QAEXVVideoMode@2@ABVString@2@IABUContextSettings@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall sf::Window::close(void)" (?close@Window@sf@@QAEXXZ) referenced in function "void __cdecl getEvents(void)" (?getEvents@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::isOpen(void)const " (?isOpen@Window@sf@@QBE_NXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall sf::Window::pollEvent(class sf::Event &)" (?pollEvent@Window@sf@@QAE_NAAVEvent@2@@Z) referenced in function "void __cdecl getEvents(void)" (?getEvents@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall sf::RenderWindow::RenderWindow(void)" (??0RenderWindow@sf@@QAE@XZ) referenced in function "void __cdecl `dynamic initializer for 'app''(void)" (??__Eapp@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall sf::RenderWindow::~RenderWindow(void)" (??1RenderWindow@sf@@UAE@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'app''(void)" (??__Fapp@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl getInputs(void)" (?getInputs@@YAXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl tick(void)" (?tick@@YAXXZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl updateScreen(void)" (?updateScreen@@YAXXZ) referenced in function _main
1>N:\Projects\C++\RTS\Debug\RTS.exe : fatal error LNK1120: 11 unresolved externals
I had a problem before of the linker not finding the .lib files, but after fixing that, I am certain it is finding them. I have them set in Linker>Input>Additional Dependencies as *-s-d.lib and I also have SFML_STATIC set in C/C++>Preprocessor>Preprocessor Definitions. Furthermore, I've seen some sources saying to set C/C++>Code Generation>Runtime Library to Multi-threaded Debug (/MDd).
The only thing I have not done is set up everything for Release, but I don't think that should affect me as long as I'm working in Debug mode. The libraries I am using are sfml-system-s-d.lib, sfml-windows-s-d.lib, and sfml-graphics-s-d.lib.
I've been working with SFML for a few years now, but I constantly get these linker errors and can never solve them. Obviously I'm missing something. Any help or insights would be greatly appreciated.