Question

I tried this simple test to see if it would work:

#include <SFML\System.hpp>
#include <iostream>

int main() 
{

    sf::Clock Clock;

    while(Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;

}

And I get the following errors:

Error   1   error LNK2019: unresolved external symbol "void __cdecl sf::Sleep(float)" (?Sleep@sf@@YAXM@Z) referenced in function _main  c:\Users\Owner\documents\visual studio 2010\Projects\Engine\Engine\main.obj Engine
Error   2   error LNK2019: unresolved external symbol "public: float __thiscall sf::Clock::GetElapsedTime(void)const " (?GetElapsedTime@Clock@sf@@QBEMXZ) referenced in function _main  c:\Users\Owner\documents\visual studio 2010\Projects\Engine\Engine\main.obj Engine
Error   3   error LNK2019: unresolved external symbol "public: __thiscall sf::Clock::Clock(void)" (??0Clock@sf@@QAE@XZ) referenced in function _main    c:\Users\Owner\documents\visual studio 2010\Projects\Engine\Engine\main.obj Engine
Error   4   error LNK1120: 3 unresolved externals   c:\users\owner\documents\visual studio 2010\Projects\Engine\Debug\Engine.exe    1   1   Engine

There is an instruction thread for installing SFML in VS 2010 here, and I followed that. Unfortunately, I still seem to have issues.

Is there anything specific I could be doing wrong?

Was it helpful?

Solution

Here's a tutorial for version 1.6, with screenshots:
> http://www.sfml-dev.org/tutorials/1.6/start-vc.php

Very important, if you link against the DLLs, you must add SFML_DYNAMIC in your project's settings (this is also mentioned in that tutorial I linked).

OTHER TIPS

If you run into "The program can't start because sfml-system.dll is missing from your computer," copy all the DLL files in your include directory and paste them in C:\Windows\system. Rebuild your project and everything should be fine now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top