title: Compiling 32bit on 64bit machine : /usr/bin/ld: cannot find -l<someLibs>
body: <p>i'm currently trying to compile some code as 32bit on a 64bit Ubuntu 12.04 machine. If i compile the code with the normal make command it all works fine.</p>
  
  <p>Now, in order to compile it as 32bit i added the -m32 option to the C- &amp; CXXFLAGS. Works fine until i get some errors about missing librarys like <code>-lGL</code>, <code>-lGLU</code>, <code>-lX11</code>, <code>-lXext</code>, <code>-lpng</code>. Okay, the first lib (<code>-lGL</code>) I found in <code>/usr/lib32/nvidia-304</code> which i added via the <code>-L</code> option. 
  The other libs are all found in <code>/usr/lib/i386-linux-gnu</code> but adding that via <code>-L</code> does not solve a thing.</p>
  
  <p>What am I missing here? Thanks in advance!</p>
  
  <p>Here is the full gcc-command leading to the error</p>
  
  <pre><code>gcc myprog.o -m32 (...) -lX11 -lXext -lpng -lm -L/usr/lib/i386-linux-gnu -lGL -L/usr/lib32/nvidia-304 -lpthread -o myprog
  /usr/bin/ld: cannot find -lX11
  /usr/bin/ld: cannot find -lXext
  /usr/bin/ld: cannot find -lpng
  </code></pre>
  
  <p>Another thing: In the <code>/usr/lib32/nvidia-304</code> i found a <code>libGL.so</code> PLUS an <code>libGL.la</code> while in <code>/usr/lib/i386-linux-gnu</code> I only can find <code>.so</code> files.</p>