Hi so i am using msVS++2010 and have been attempting to set up SFML all day.... I downloaded 1.6 from the site, then rebuilt it in VS2010, but sad to find that this did not result in a sfml-system-d.lib file, which is what i am used to using, and only produced new system-s and system-s-d libs.
接着,我密切注视了Video,发现他通过在外添加fml-system-s-d的校准,在外面添加显示工作的录像带的fml-system-dll,并读到以下正典:
#include <iostream>
#include <SFML/System.hpp>
int main(int argc, char **argv)
{
sf::Clock clock;
sf::Sleep(0.1f);
while(clock.GetElapsedTime() < 5.0f)
{
std::cout << clock.GetElapsedTime() << std::endl;
sf::Sleep(0.5f);
}
}
显然24小时和睡眠都在发挥作用,但是,如果加上一条简单的编码线,则:Thread thread();一个错误的盒子pop起来,说,“无法启动方案”,“组合是不正确的,”“审查可能的错误的原始文件,”“储存我的固定装置。
Also: when trying to run the first program of the tutorials regarding threads:
#include <SFML/System.hpp>
#include <iostream>
void ThreadFunction(void* UserData)
{
// Print something...
for (int i = 0; i < 10; ++i)
std::cout << "I m the thread number 1" << std::endl;
}
int main()
{
// Create a thread with our function
sf::Thread Thread(&ThreadFunction);
// Start it !
Thread.Launch();
// Print something...
for (int i = 0; i < 10; ++i)
std::cout << "I m the main thread" << std::endl;
return EXIT_SUCCESS;
}
我获得8个无遗的外部象征,如:
1>sfml-system-s-d.lib(Thread.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::ios_base::width(int)" (__imp_?width@ios_base@std@@QAEHH@Z)
fatal error LNK1120: 8 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Lastly this is how my project is set up:
- include directory to out of the box, freshly downloaded SFML 1.6/include
- lib directory to the VS2010 rebuilt SFML (debug/release DLL setting, and static).
- extra dependency on sfml-system-s-d.lib file.
- out of frusteration i placed every dll file next to the .exe