clueboy / pymssql_issues

0 stars 0 forks source link

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

Closed clueboy closed 11 years ago

clueboy commented 11 years ago

From msabramo on January 02, 2013 17:45:39

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/libsybdb.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/libsybdb.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=1ac4be0b50c937e61574da40ff54923067871305

Original issue: http://code.google.com/p/pymssql/issues/detail?id=106

clueboy commented 11 years ago

From msabramo on January 06, 2013 18:11:54

Summary: OS X: "Symbol not found: _dbadata" error when importing pymssql (was: Link problems on OS X)
Status: Started
Owner: msabramo

clueboy commented 11 years ago

From msabramo on January 06, 2013 18:58:55

Fixed with http://code.google.com/p/pymssql/source/detail?r=88d15d12558625a4d7b8e2d518e24f53c20223c9

Status: Fixed