logo       

python dont find init function: msg#00140

programming.swig

Subject: python dont find init function

Hi everybody,

im trying to run the python example "simple" code on my linux (suse2.2)
system, but python complains that the module lacks an init function. ive done
the following:

copied the example.c and example.i files to my home directory, compiled them
and tried to load the module.

ludi@bob3:~/perl> swig -python example.i
ludi@bob3:~/perl> gcc -c -fpic example.c example_wrap.c
-I/usr/include/python2.2
ludi@bob3:~/perl> gcc -shared example.o example_wrap.o -o examplemodule.so
ludi@bob3:~/perl> python
Python 2.2.2 (#1, Mar 17 2003, 15:17:58)
[GCC 3.3 20030226 (prerelease) (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import example
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: dynamic module does not define init function (initexample)
>>>
ludi@bob3:~/perl>

can anybody help me to fix this problem? by the way, my swig version is
1.3.17-51

ive surfed the mailing lists but maybe im looking in the wrong place - i found
several posts about that problem, but they dated from ~2000. some people say
its because the init function has the "wrong" name?

thanks very much in advance.

Ludwig

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise