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]

Re: program using std::thread terminated abnormally


shengli li <goodhorce@gmail.com> writes:
> ??? 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?
> 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

Try the g++ "-pthread" option:

   $ g++-4.5 -std=c++0x 1.cpp
   $ ./a.out
   terminate called after throwing an instance of 'std::system_error'
     what():  
   Aborted
   $ g++-4.5 -std=c++0x -pthread 1.cpp
   $ ./a.out
   $

-miles

-- 
`The suburb is an obsolete and contradictory form of human settlement'


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