2
« on: October 13, 2009, 04:52:53 pm »
I've been having issues trying to link to the SFML libraries, specifically sfml-window and sfml-graphics. I've tried all the configurations I could think of, debug, release, static-debug, static-release, etc. Taking note to define SFML_DYNAMIC for any of the dynamic libraries.
With the following code taken from the tutorials, including the libraries sfml-main-d.lib and sfml-window-s-d.lib -
#include <SFML/Window.hpp>
int main(int argc, char** argv)
{
// Create the main rendering window
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
// Start game loop
while (App.IsOpened())
{
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}
I receive the following linker errors -
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function "public: __thiscall sf::Window::Window(void)" (??0Window@sf@@QAE@XZ)
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "public: void __thiscall sf::Clock::Reset(void)" (?Reset@Clock@sf@@QAEXXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "void __cdecl sf::Sleep(float)" (?Sleep@sf@@YAXM@Z) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
1>sfml-window-s-d.lib(Window.obj) : error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function "public: void __thiscall sf::Window::Display(void)" (?Display@Window@sf@@QAEXXZ)
I've also built the libraries from source as well, hoping it would solve the issue, but alas nothing seems to be helping. I've noticed that it's particularly having issues with sf::Clock's methods and sf::Sleep. I'm hoping I'm just missing something simple, otherwise I may just try and remove Clock/Sleep from the libraries and re-build them. Though I'd rather not have to start hacking and slashing the libraries.
Compiled under Windows 7 64-bit, Visual Studio 2008 Professional
Oh, and just in case it helps, here's the command line taken from VS9.
/OUT:"C:\Users\Null\Projects\Test\Debug\Test.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\Test.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Null\Projects\Test\Debug\Test.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT sfml-main-d.lib sfml-window-s-d.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib