platiumky / pymssql

Automatically exported from code.google.com/p/pymssql
GNU Lesser General Public License v2.1
0 stars 0 forks source link

OS X: "Symbol not found: _dbadata" error when importing pymssql #106

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, pymssql bundles FreeTDS binaries and headers for Linux and Windows 
but not for Mac. When building on a Mac (I'm using OS X 10.8.2), it tries to 
link with the Linux binaries and then fails. The following warning happens 
during a build (e.g.: `python setup.py develop`):

ld: warning: ignoring file /Users/marca/dev/hg-repos/msabramo-pymssql-osx-freetds/freetds/nix_64/lib/libsyb db.a, file was built for archive which is not the architecture being linked (x86_64): /Users/marca/dev/hg-repos/msabramo-pymssql-osx-freetds/freetds/nix_64/lib/libsyb db.a


and then when trying to use the code, the following error occurs:

File "_mssql.pxd", line 10, in init pymssql (pymssql.c:9379) cdef class MSSQLConnection: ImportError: dlopen(/Users/marca/dev/hg-repos/msabramo-pymssql-osx-freetds/_mssql.so, 2): Symbol not found: _dbadata Referenced from: /Users/marca/dev/hg-repos/msabramo-pymssql-osx-freetds/_mssql.so Expected in: flat namespace in /Users/marca/dev/hg-repos/msabramo-pymssql-osx-freetds/_mssql.so


To fix this, I suggest the following change which adds FreeTDS libraries and 
headers under freetds/darwin_64 and then modified setup.py slightly so that OS 
X builds use these. This works for me on my OS X 10.8.2 MacBook Pro system.

http://code.google.com/r/msabramo-pymssql-osx-freetds/source/detail?r=1ac4be0b50
c937e61574da40ff54923067871305

Original issue reported on code.google.com by msabr...@gmail.com on 3 Jan 2013 at 1:45

GoogleCodeExporter commented 8 years ago

Original comment by msabr...@gmail.com on 7 Jan 2013 at 2:11

GoogleCodeExporter commented 8 years ago
Fixed with 
http://code.google.com/p/pymssql/source/detail?r=88d15d12558625a4d7b8e2d518e24f5
3c20223c9

Original comment by msabr...@gmail.com on 7 Jan 2013 at 2:58