By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,986 Members | 1,583 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,986 IT Pros & Developers. It's quick & easy.

Undefined symbol errors upon import of an extension I made.

P: n/a
An extension I used uses some other functions i made (outside of the sources used by the extension itself), but it complains about them upon import as being undefined symbols.

Expand|Select|Wrap|Line Numbers
  1. >>> import libpytwo2gam 
  2. Traceback (most recent call last):
  3.   File "<stdin>", line 1, in <module>
  4. ImportError: ./libpytwo2gam.so: undefined symbol: twoll_linearsearch
  5. >>> 
  6.  
twoll_linearsearch() is a function in an object file I include in the extra_objects member of the Extension object I make in the setup.py script. Here's the script:

Expand|Select|Wrap|Line Numbers
  1.  
  2. from distutils.core import setup, Extension
  3.  
  4. ARCH = 'x86_64'
  5.  
  6. extra = ['../../../misc/ll/'+ARCH+'_tmp/ll.o',
  7.          '../../simple/'+ARCH+'_tmp/srctools.o',
  8.          '../'+ARCH+'_tmp/util.o',
  9.          '../'+ARCH+'_tmp/extern.o']
  10. print extra
  11.  
  12. two2gam_module = Extension('libpytwo2gam',
  13.                            sources=['pyext.c'],
  14.                            extra_objects = extra,
  15.                            libraries=['SDL', 'SDL_image'])
  16.  
  17. setup(name = 'libpytwo2gam',
  18.        version = '0.0.1',
  19.        description = 'Python Interface for two2gam',
  20.        author = '{2}rIng',
  21.        author_email = 'xxx@xxx.com',
  22.        long_description = '''
  23. Description says it (IOW, long_descriptions goes here!).
  24. ''',
  25.        ext_modules = [two2gam_module])
  26.  
Oct 31 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.