I installed boost library for c++, I built it and stuff. I tried the example code that was at the boost website and it worked. But I dont know how to work with Boost.thread library. I built it with bjam, and I tried some code that came with the installation, but I get some errors. I think I have to do something with the linker, but I dont know what. Im using Visual C++ 2008.
Code:
// Copyright (C) 2001-2003
// William E. Kempf
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <boost/thread/thread.hpp>
#include <iostream>
void helloworld()
{
std::cout << "Hello World!" << std::endl;
}
int main()
{
boost::thread thrd(&helloworld);
thrd.join();
}
Errors from the Build Log:
Output Window
Linking...
asd.obj : error LNK2001: unresolved external symbol __imp__key
MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C:\Documents and Settings\User\My Documents\Visual Studio 2008\Projects\test\Debug\test.exe : fatal error LNK1120: 2 unresolved externals