I am trying to include atomic in my C++ pthread program.
#include <atomic>
But, i got error:
error: atomic: No such file or directory
I tried :
#include <asm/atomic>
#include <atomic.h>
#include <linux/atomic>
#include <util/atomic>
#include <stdcatomic>
#include <catomic>
No one works.
My gcc is gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)
The post :
#include <cstdatomic> "no such file" in ubuntu
std::atomic support in g++ 4.4.3
do not work either.
And #include <thread> also got : No such file or directory
Any help will be appreciated.
thanks !
UPDATE,
I am trying to install GCC 4.7 on Linux, but in "make check", I got error,
autogen -T /remote/mypath/gcc_4_7_2012_5_28/gcc_4_7_new_2012_5_29/trunk/fixincludes/check.tpl , remote/mypath/gcc_4_7_2012_5_28/gcc_4_7_new_2012_5_29/trunk/fixincludes/inclhack.def ,
make[2]: execvp: autogen: Permission denied, then I tried to install autogen, but
got: I need to install guile-devel, then when I installed guile-2.0.5-2.1.src.rpm ,
I got rpm -ivh guile-2.0.5-2.1.src.rpm, warning: guile-2.0.5-2.1.src.rpm: Header V3
RSA/SHA256 signature: NOKEY, key ID 3dbdc284
error: cannot write to %sourcedir /usr/src/redhat/SOURCES, I cannot get root
authorization.
Any help will be appreciated. thanks !
<atomic>. - user784668atomicwas introduced in a newer version of C++ (C++11). Your g++ has been written beforeatomicwas invented! - Shahbaz