title: How to include <atomic> in C++ on Linux?
body: <p>I am trying to include atomic in my C++ pthread program.</p>
  
  <pre><code>#include &lt;atomic&gt;
  </code></pre>
  
  <p>But, i got error: </p>
  
  <p>error: atomic: No such file or directory</p>
  
  <p>I tried :</p>
  
  <pre><code> #include &lt;asm/atomic&gt;
   #include &lt;atomic.h&gt;
   #include &lt;linux/atomic&gt;
   #include &lt;util/atomic&gt;
   #include &lt;stdcatomic&gt;
   #include &lt;catomic&gt;
  </code></pre>
  
  <p>No one works. </p>
  
  <p>My gcc is  gcc version 4.1.2 20080704 (Red Hat 4.1.2-52)</p>
  
  <p>The post :</p>
  
  <p><a href="https://stackoverflow.com/questions/7697588/include-cstdatomic-no-such-file-in-ubuntu">#include &lt;cstdatomic&gt; &quot;no such file&quot; in ubuntu</a></p>
  
  <p><a href="https://stackoverflow.com/questions/4620559/stdatomic-support-in-g-4-4-3">std::atomic support in g++ 4.4.3</a></p>
  
  <p>do not work either. </p>
  
  <pre><code>And #include &lt;thread&gt; also got : No such file or directory
  </code></pre>
  
  <p>Any help will be appreciated. </p>
  
  <p>thanks !</p>
  
  <p>UPDATE, </p>
  
  <p>I am trying to install GCC 4.7 on Linux, but in "make check", I got error, </p>
  
  <pre><code>   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. 
  </code></pre>
  
  <p>Any help will be appreciated. thanks !</p>