This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

program using std::thread terminated abnormally


Hello,

??? I compiled GCC 4.5.1 on on SUSE linux, but my program which use
std::thread cannot run. I checked GCC help pages and configured GCC
with --enable-threads. How can I solve this?

The detailed information is:
linux-roger:/home/lishli/cpp # uname -a
Linux linux-roger 2.6.16.60-0.54.5-default #1 Fri Sep 4 01:28:03 UTC
2009 i686 i686 i386 GNU/Linux
linux-roger:/home/lishli/cpp # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/lishli/gcc/libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --prefix=/home/lishli/gcc
--enable-languages=c,c++ --enable-threads --enable-tls
Thread model: posix
gcc version 4.5.1 (GCC)
linux-roger:/home/lishli/cpp # cat 1.cpp
#include <thread>

void do_nothing(){}

int main() {
? std::thread t(do_nothing);
}
linux-roger:/home/lishli/cpp # g++ -std=c++0x 1.cpp
linux-roger:/home/lishli/cpp # ./a.out
terminate called after throwing an instance of 'std::system_error'
? what():
Aborted


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]