Я использую Dev C ++ в Windows XP, и я скачал пакет Boost v 1.46.0 и установил его. Я хочу использовать его для создания потоков, но не могу скомпилировать даже самый простой код.
Мой код:
#include <boost/thread.hpp>
using namespace boost;
void something()
{
}
int main ()
{
thread rawr = thread(something);
return 0;
}
Составить журнал:
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x3526):thread.cpp: undefined reference to `gettimeofday'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x3551):thread.cpp: undefined reference to `_gmtime32'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x393e):thread.cpp: undefined reference to `gettimeofday'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x3966):thread.cpp: undefined reference to `_gmtime32'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x3e9e):thread.cpp: undefined reference to `gettimeofday'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x3ec9):thread.cpp: undefined reference to `_gmtime32'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x533a):thread.cpp: undefined reference to `gettimeofday'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x5365):thread.cpp: undefined reference to `_gmtime32'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x57f0):thread.cpp: undefined reference to `gettimeofday'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text+0x581b):thread.cpp: undefined reference to `_gmtime32'
.../Dev-Cpp/lib/libboost_thread.a(thread.o)(.text$_ZN5boost9date_time6c_time6gmtimeEPKlP2tm[boost::date_time::c_time::gmtime(long const*, tm*)]+0x44):thread.cpp: undefined reference to `_gmtime32'
collect2: ld returned 1 exit status
make.exe: *** [project.exe] Error 1
Execution terminated
Я связал libboost_thread.a в настройках проекта, но, думаю, мне нужно что-то большее? Заранее спасибо:)