From: David F. <dav...@in...> - 2014-04-16 13:48:17
|
Hi, It looks like file.i contains: %module test instead of: %module filename so the Python generated code tries to load a dyanmic library _test.so instead of _filename.so Hope it helps, David Quoting ch...@ph... (2014-04-16 13:09:41) > Hi, > > I got some weired errors: > I generated sucessfully a module with SWIG from C++ which I could used the > first time in python. It worked. But after I try to change so. on the > file.cxx, the file.h and the interfacefile and compiled again, it doesn't > work anymore. > I removed all the changed things to the state where it did work and > recompiled it with: > > $ swig -python -c++ file.i > $ g++ -fPIC -c file.cxx file_wrap.cxx -I/usr/include/python2.7 > $ g++ -shared file.o file_wrap.o -o _filename.so > > All this steps worked fine, but when I try to import > <<import filename as f > pyhton got the following error in the generated file.py from SWIG: > > line 22, in swig_import_helper > _mod = imp.load_module('_test', fp, pathname, description) > > I looked in the file.py at line 22: > $if fp is not None: > try: > _mod = imp.load_module('_test', fp, pathname, description) > > Can somebody tell me please what to do? > Thank you, > best regards Vanessa > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/NeoTech > _______________________________________________ > Swig-user mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-user |