title: How can I link against libpython.a such that the runtime linker can find all the symbols in libpython.a?
body: <p>In a sequel question to <a href="https://stackoverflow.com/questions/1469370/why-cant-i-import-the-math-library-when-embedding-python-in-c">this question</a>, my corporate environment lacks the <code>libpython2.6.so</code> shared object but has the <code>libpython2.6.a</code> file.  Is there a way that I can compile in <code>libpython2.6.a</code> while retaining the symbols in <code>libpython2.6.a</code> such that dynamic libraries can find these symbols at runtime?</p>
  
  <p>My current compile with the static library looks like:</p>
  
  <pre><code>g++ -I/usr/CORP/pkgs/python/2.6.2/include/python2.6 \
      ~/tmp.cpp -pthread -lm -ldl -lutil \
      /usr/CORP/pkgs/python/2.6.2/lib/python2.6/config/libpython2.6.a \
      -o tmp.exe
  </code></pre>
  
  <p>However, if I load a module like 'math', it dies with:</p>
  
  <pre><code>undefined symbol: PyInt_FromLong
  </code></pre>