wrapping c++ for python on windows problem

Alexandre Gillet gillet at scripps.edu
Tue Feb 25 22:05:40 EST 2003


Hi,

I am trying to wrappe a c++ library using swig on windows(windows 
2000,swig1.3.11). I am able to build for my module dll but when I load 
my module videolib,I get the following error:
the dynamic link library libARvideo.dll could not be found

But I did get link with the library libARvideo.lib, I do not have a dll 
for the c++ library.

Here is my interface file videolib.i and the command I used to build my 
python module:

%{

int       arVideoOpen( char *config );
%}
int        arVideoOpen( char *config );

##########################################

Here is the swig command I used:
H:\Swig\SWIG-1.3.11\swig.exe -python -dump_tree -shadow -c++ -no_default
  -DSWIG_RELEASE=1.3.11 -DSWIG_TYPE=python -IH:\Python\Python2.1\include 
-IH:\Python\Python2.1\PC -IH:\Python\Python2.1\Include -I..\..\include 
-D_WIN32 -IH:\Swig\SWIG-1.3.11\Lib -IH:\Swig\SWIG-1.3.11\Lib\python 
-module videolib -o videolib.swigout videolib.i > videolib.swigtree

H:\Python\Python2.1\libplus\bin\pybatch.bat "H:\Python\Python2.1\libplus
;H:\ARToolKit\ARToolKit-DS-2.65b;H:\ARToolKit\ARToolKit-DS-2.65b\python/videopython" 
H:\Python\Python2.1\python21.exe -c "import tool; tool.run()" filter  -i 
videolib.swigout -o videolib.precious.c

H:\ARToolKit\ARToolKit-DS-2.65b\python\videopython>H:\Python\Python2.1\python21.
exe -c "import tool; tool.run()" filter -i videolib.swigout -o 
videolib.precious

Command use to compile:
         CL.EXE -c -nologo -W3 -Gy -Ox -GD -MD  -DSWIG_RELEASE=1.3.11 
-DSWIG_TYPE=python -IH:\Python\Python2.1\include 
-IH:\Python\Python2.1\PC -IH:\Python\Pythn2.1\Include -I..\..\include -F 
-o videolib.obj videolib.precious.c

Link:
link -debug -nologo -warn:3 -map -dll -export:initvideolibc 
-out:videolbc.dll videolib.obj -LIBPATH:..\..\lib libARvideo.lib 
-LIBPATH:H:\Python\Python2.1\libs python21.lib


Any idea what I am doing wrong?
In the Library the function I need to access is define in the .h file by:

int __declspec(ddlexport) arVideoOpen( char *config );


Thanks
-- 
   o Alexandre Gillet               email: gillet at scripps.edu
  /  The Scripps Research Institute,
o   Dept. Molecular Biology,  MB-5,
  \  10550  North Torrey Pines Road,
   o La Jolla,  CA 92037-1000,  USA.
  /  tel: (858) 784-2053
o   fax: (858) 784-2860









More information about the Python-list mailing list