Re: program using std::thread terminated abnormally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



shengli li <goodhorce@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux