title: How to cross compile from windows g++ cygwin to get linux executable file
body: <p>I have an updated cygwin-full install ,mingw ,codeblocks on a windows system. 
  i have a c++ program which performs xml generation based on input. </p>
  
  <p>I understand to build an executable file for unix we use makefiles. makefiles being typical project files .
  Hence i used the plugin cbp2make.exe to get the makefile for the cbp project file. and i tried to execute make in cygwin. hoping to get a linux executable file. but this was clearly wrong.</p>
  
  <p>a typical test c++ test program <code>test.c</code> would be compiled in cygwin using gcc cross compile options like.</p>
  
  <pre><code>g++-linux -o test test.c
  </code></pre>
  
  <p>this would give us the linux executable file test or if no name is specified it would give an a.out</p>
  
  <p>This is all well and good for a simple c++ program with no included header files.</p>
  
  <p>I understand when we are dealing with c++ files with lot of external library files a simple <code>g++ -o ourprojfile.exe ourprojectfile.cpp</code> does not work hence we would need to use make files. <strong>Question 1 : Am i wrong in assuming this ?*</strong></p>
  
  <p><strong>Question 2: how can we setup cross compile to get a linux executable file directly from codeblocks.</strong></p>
  
  <hr>
  
  <p>Update : the problem at my end seems to be missing dependent cpp files which i assumed i included in the main file.
  The solution was to include them in the main file or simply write handle like so</p>
  
  <pre><code>g++-linux myprog_linux main.cpp first.cpp second.cpp third.cpp 
  </code></pre>
  
  <p>The problem now is after i get the Linux executable file. 
  when i try to run it on linux machine i get the error of a </p>
  
  <pre><code> /usr/local/folder/myfile/my_prog_nix: error while loading shared libraries: 
  libstdc++.so.5: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>what sort of linking do i need to do clear this?</p>