title: Compiling c/c++ program on angstrom
body: <p>C and C++ program is not compiling on Angstrom OS</p>
  
  <p><br /><br>
  C Progam (board.c):</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  void main(){
      printf("hello world");
  }
  </code></pre>
  
  <p><br />
  Compiling C program on Angstrom Terminal</p>
  
  <pre><code>root@pldek-beagle:~/Comparison# gcc board.c -o board
  /usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: this linker was not configured to use sysroots
  collect2: error: ld returned 1 exit status
  
  
  root@pldek-beagle:~/Comparison# gcc --sysroot=/usr/local  board.c -o board
  board.c:1:18: fatal error: stdio.h: No such file or directory
  compilation terminated.
  
  root@pldek-beagle:~/Comparison# whereis stdio
  stdio: /usr/include/stdio.h
  
  root@pldek-beagle:~/Comparison# echo $PATH
  /mnt/data/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/include/c++/:/usr/include/:/usr/include/c++/:/usr/include/c++:/usr/include/c++/:/usr/include/c++/:/usr/include/c++/:/usr/include/:/usr/include
  </code></pre>
  
  <p>
  As you can see above , stdio.h path is available in $PATH even then the gcc is not able to find it. </p>
  
  <p><br />
  C++ Progam (beagle.cpp):</p>
  
  <pre><code>using namespace std;
  #include&lt;iostream&gt;
  void main(){
      cout&lt;&lt;"hello world";
  }
  </code></pre>
  
  <p><br />
  Compiling C++ program on Angstrom Terminal</p>
  
  <pre><code>root@pldek-beagle:~/Comparison# g++ beagle.cpp -o beagle
  /usr/lib/gcc/arm-angstrom-linux-gnueabi/4.7.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: this linker was not configured to use sysroots
  collect2: error: ld returned 1 exit status
  
  root@pldek-beagle:~/Comparison# g++ --sysroot=/usr/local  beagle.cpp -o beagle
  beagle.cpp:2:19: fatal error: iostream: No such file or directory
  compilation terminated.
  
  root@pldek-beagle:~/Comparison# whereis iostream
  iostream: /usr/include/c++/iostream
  
  echo $PATH
  /mnt/data/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/include/c++/:/usr/include/:/usr/include/c++/:/usr/include/c++:/usr/include/c++/:/usr/include/c++/:/usr/include/c++/:/usr/include/:/usr/include
  </code></pre>
  
  <p>As you can see above , iostream path is available in $PATH even then the g++ is not able to find it. </p>