[sisyphus] boost-threads

andy Tatarinov =?iso-8859-1?q?elephantum_=CE=C1_dezcom=2Emephi=2Eru?=
Вт Окт 8 17:06:58 MSD 2002


Ктонибудь пробовал мспользовать boost-threads? просто при попытке
собрать пример с boost.org (http://boost.org/thread/doc/thread.html)

$ cat test.cc

#include <boost/thread/thread.hpp>
#include <iostream>

struct thread_alarm
{
   thread_alarm(int secs) : m_secs(secs) { }
   void operator()()
   {
       boost::xtime XT;
       boost::xtime_get(&XT, boost::TIME_UTC);
       xt.sec += m_secs;

       boost::thread::sleep(XT);

       std::cout << "alarm sounded..." << std::endl;
   }

   int m_secs;
};

int main(int argc, char* argv[])
{
   int secs = 5;
   std::cout << "setting alarm for 5 seconds..." << std::endl;
   thread_alarm alarm(secs);
   boost::thread thrd(alarm);
   thrd.join();
}

$ make
cd /home/el/proj/bthreads/
make -k 
g++ `boost-thread-config --cflags` -c test.cpp
In file included from /usr/include/boost/config.hpp:35,
                 from /usr/include/boost/thread/thread.hpp:15,
                 from test.cpp:1:
/usr/include/boost/config/compiler/gcc.hpp:57:7: warning: #warning
"Unknown compiler version - please run the configure tests and report
the results"
test.cpp: In member function `void thread_alarm::operator()()':
test.cpp:9: aggregate `boost::xtime XT' has incomplete type and cannot
be defined
test.cpp:10: `TIME_UTC' undeclared in namespace `boost'
test.cpp:10: `xtime_get' undeclared in namespace `boost'
test.cpp:11: `xt' undeclared (first use this function)
test.cpp:11: (Each undeclared identifier is reported only once for each
function it appears in.)
make: *** [test.o] Error 1
make: Target `test' not remade because of errors.

Compilation exited abnormally with code 2 at Tue Oct  8 16:58:45

$ rpm -qa | grep gcc
gcc-common-1.1.4-alt1
gcc3.2-3.2.1-alt0.4
gcc3.2-c++-3.2.1-alt0.4
libgcc3.2-3.2.1-alt0.4
libgcc3.2-debug-3.2.1-alt0.4

$ rpm -qa | grep boost
boost-devel-1.28.0-alt0.4
boost-thread-1.28.0-alt0.4
boost-thread-devel-1.28.0-alt0.4

при попытке скомпилировать пример с thread_groups ошибок выводится на
пару экранов.

-- 
...2b|!2b?




Подробная информация о списке рассылки Sisyphus