"Undefined symbols:" Error in Example

Asked by makemachine

Hello,

I'm just getting started with pybindgen on Mac running Snow Leopard.

I've placed pybindgen in the site-packages dir and I'm attempting to run first-example, downloaded from http://code.google.com/p/pybindgen/source/browse/trunk/tutorial/first-example.zip?r=10.

As per the instructions here: http://packages.python.org/PyBindGen/tutorial.html#a-simple-example, under: Building it (GCC instructions) I cd to the first-example dir and type "make". The following output is produced:

gcc -fPIC -c -o my-module.o my-module.c
gcc -shared -o libmymodule.so my-module.o
PYTHONPATH=$PYTHONPATH:../../ python my-module.py > my-module-binding.c
gcc -fPIC -I/usr/include/python2.5 -c -o my-module-binding.o my-module-binding.c
gcc -shared -o MyModule.so -L. -lmymodule my-module-binding.o
Undefined symbols:
  "_Py_InitModule4_64", referenced from:
      _initMyModule in my-module-binding.o
  "__Py_NoneStruct", referenced from:
      __wrap_MyModuleMyModuleDoAction in my-module-binding.o
      __wrap_MyModuleMyModuleDoAction in my-module-binding.o
      __wrap_MyModuleMyModuleDoAction in my-module-binding.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [MyModule.so] Error 1

It appears that both binding files ( .o, .c ) and libmymodule.so are generated. My question is, what are these Undefined Symbols? Is this going to affect anything or can these errors be ignored?

Thanks,
~Jeremy

Question information

Language:
English Edit question
Status:
Answered
For:
PyBindGen Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Gustavo Carneiro (gjc) said :
#1

Most likely the build instructions in the tutorial only work in Linux systems. Try building the extension with python distutils instead.

Revision history for this message
Gustavo Carneiro (gjc) said :
#2

Can you help with this problem?

Provide an answer of your own, or ask makemachine for more information if necessary.

To post a message you must log in.