我正在尝试在 VS 2008 中遵循 Boost::Thread (ver 1.4-3) 的简单教程:
#include <boost/thread/thread.hpp>
void Func()
{
// Do something
}
void main()
{
boost::thread _thrd(&Func);
_thrd.join();
....
}
在编译期间它会产生这个错误:
Error 1 fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-gd-1_43.lib' CConsole
我必须通过添加来解决#define BOOST_ALL_NO_LIB
。但是,它给了我另一个错误:
Error 3 fatal error LNK1120: 2 unresolved externals
C:\xx\Documents\Visual Studio 2008\Projects\CConsole\Debug\CConsole.exe
Error 1 error LNK2019: unresolved external symbol "public: __thiscall boost::thread::~thread(void)" (??1thread@boost@@QAE@XZ) referenced in function _wmain CConsole.obj
Error 2 error LNK2019: unresolved external symbol "private: void __thiscall boost::thread::start_thread(void)" (?start_thread@thread@boost@@AAEXXZ) referenced in function "public: __thiscall boost::thread::thread<void (__cdecl*)(void)>(void (__cdecl*)(void),struct boost::thread::dummy *)" (??$?0P6AXXZ@thread@boost@@QAE@P6AXXZPAUdummy@01@@Z) CConsole.obj
有谁知道如何解决这个问题?
谢谢。