* [sisyphus] boost-threads
@ 2002-10-08 13:06 andy Tatarinov
0 siblings, 0 replies; only message in thread
From: andy Tatarinov @ 2002-10-08 13:06 UTC (permalink / raw)
To: sisyphus
Ктонибудь пробовал мспользовать 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?
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-10-08 13:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-08 13:06 [sisyphus] boost-threads andy Tatarinov
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git