statically linking libpq to psycopg2

From: john blair <mailtome200420032002(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: statically linking libpq to psycopg2
Date: 2010-02-03 19:15:16
Message-ID: 880410.21598.qm@web53101.mail.re2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to link statically psycopg2-2.0.13 to libpq.a on my mac os 10.5.5. The build goes fine and libpq is statically linked:
otool -L build/lib.macosx-10.3-i386-2.6/psycopg2/_psycopg.so
build/lib.macosx-10.3-i386-2.6/psycopg2/_psycopg.so:
/usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
/usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.2)

But when I try to import psycopg2 I get:

Python 2.6.1 (r261:67515, Dec 6 2008, 10:32:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tools/python-2.6.1/lib/python2.6/site-packages/psycopg2/__init__.py", line 60, in <module>
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/tools/python-2.6.1/lib/python2.6/site-packages/psycopg2/_psycopg.so, 2): Symbol not found: _error_message
Referenced from: /tools/python-2.6.1/lib/python2.6/site-packages/psycopg2/_psycopg.so
Expected in: dynamic lookup

Browse pgsql-general by date

  From Date Subject
Next Message Andrej 2010-02-03 19:50:40 Re:
Previous Message Tom Lane 2010-02-03 15:42:44 Re: PQendcopy:resetting connection Problem and Cannot insert a duplicate key into unique index