title: undefined reference to `std::ios_base::Init::Init()'
body: <p>I write this code to read 3 files, TM is the size of square matrix, LER the No. of rows of an array and from last value define a non-square matrix of (ler/2)*2</p>
  
  <p>Then... the code read a file with some relations, all are numbers and are assign to C[ler].</p>
  
  <p>Then ... C[ler] is assigned to B[ler/2][2].</p>
  
  <p>Those coordinates, per row, in B[ler/2][2] are assign to a and b.</p>
  
  <p>a and b are the row and the column of the matrix A[tm][tm] where to add 1.</p>
  
  <p>My code crashes and I don't see what the error is.</p>
  
  <p>When I try to compile it, the compiler <strong>gcc -g -o MatSim MatSim.cpp</strong> prompted:</p>
  
  <pre><code>/usr/include/c++/4.6/iostream:75: undefined reference to `std::ios_base::Init::Init()'
  /usr/include/c++/4.6/iostream:75: undefined reference to `std::ios_base::Init::~Init()'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Also, when I try to compile it, the compiler <strong>f77 -o MatSim MatSim.cpp</strong> prompted:</p>
  
  <pre><code>/tmp/cc6ewlkf.o: In function `__static_initialization_and_destruction_0(int, int)':
  MatSim.cpp:(.text+0x17ad4a): undefined reference to `std::ios_base::Init::Init()'
  MatSim.cpp:(.text+0x17ad4f): undefined reference to `std::ios_base::Init::~Init()'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p><strong>Solution</strong></p>
  
  <p>The main problem was a library problem, Compile your code using:</p>
  
  <pre><code> g++ -g -o MatSim MatSim.cpp -lstdc
  </code></pre>
  
  <p>Still not working?  Install libraries:</p>
  
  <pre><code>sudo apt-get install g++-multilib
  </code></pre>