I just started to learn SFML and I can't even get through the second example code. The first one,
http://www.sfml-dev.org/tutorials/1.6/start-vc.php, compiled fine. But the second tutorial program, about threads, gives me this error:
error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall std::basic_streambuf<char,struct std::char_traits<char> >::sputn(char const *,int)" (__imp_?sputn@?$basic_streambuf@DU?$char_traits@D@std@@@std@@QAEHPBDH@Z) c:\documents and settings\~~~~\my documents\visual studio 2010\Projects\SFML3\SFML3\sfml-system-s.lib(Thread.obj) SFML3
The code is
#include <SFML\System.hpp>
#include <iostream>
void ThreadFunction(void* UserData) {
for (int i = 0; i < 10; ++i)
std::cout << "I'm the thread number 1" << std::endl;
}
int main() {
sf::Thread Thread(&ThreadFunction);
Thread.Launch();
for (int i = 0; i < 10; ++i)
std::cout << "I'm the main thread" << std::endl;
return EXIT_SUCCESS;
}
I used "Release" option and linked to "sfml-system-s.lib", with Visual Studio 2010. The tutorial said it would work, so first I didn't compile SFML myself, then when I got this error I tried, but I wasn't even able to compile it because of tons of errors.
The thread-example DOES compile fine when using sfml-system.lib when declared with SFML_DYNAMIC. But I'd like a static link. How can I solve this problem? I don't want to download vc2008 just for this.