title: (solaris) ld: fatal: ... version 'GCC_4.2.0' does not exist
body: <p>I'm trying to compile a c++ program for the first time on this machine (which is not mine), so I've written a simple hello world. My command to compile gets an error, </p>
  
  <pre><code>&gt;g++ testing.cpp -L/usr/local/lib
  ld: fatal: file /usr/local/lib/libgcc_s.so: version 'GCC_4.2.0' does not exist:
      required by file /usr/local/lib/libstdc++.so
  </code></pre>
  
  <p>but I have something there:</p>
  
  <pre><code>&gt;file /usr/local/lib/libgcc_s.so
  /usr/local/lib/libgcc_s.so:     ELF 32-bit LSB dynamic lib 80386 Version 1 [FPU], dynamically linked, not stripped
  </code></pre>
  
  <p>For giggles if I do any of these: </p>
  
  <pre><code>&gt;g++ testing.cpp
  &gt;g++ testing.cpp -L/usr/sfw/bin
  &gt;g++ testing.cpp -L/local/bin
  </code></pre>
  
  <p>I get this same exact error (directory does not change, probably because there's no libgcc_s in bin?):</p>
  
  <pre><code>ld: fatal: file /usr/local/lib/gcc/i386-pc-solaris2.10/4.3.3/../../../libgcc_s.so: version 'GCC_4.2.0' does not exist:
      required by file /usr/local/lib/gcc/i386-pc-solaris2.10/4.3.3/../../../libstdc++.so
  </code></pre>
  
  <p>Located in <code>/usr/local/lib/gcc/i386-pc-solaris2.10/</code> I see <code>3.4.6</code> and <code>4.3.3</code>.</p>
  
  <p>And I see that a symlink of <code>/usr/local/lib/libcc_s.so</code> points to <code>libgcc_s.so.1</code> created in 2001...</p>
  
  <p>I saw elsewhere the following way to check the version, but it returns nothing:</p>
  
  <pre><code>/usr/local/lib&gt;strings libgcc_s.so.1 | grep GCC
  </code></pre>
  
  <p>My questions are:</p>
  
  <ol>
  <li>What exactly is going on? Does the linker accept "kinda old" libraries but reject really old ones, like 2001? Will the linker ever get upset at too NEW of a version? </li>
  <li>Is there any way to tell what version the libgcc_so is?</li>
  <li>Can I cheat and force it to use the currently installed version by creating a symlink? If so, what symlink should I create?</li>
  </ol>
  
  <p>Thank you for reading and for any advice you can give.</p>