Following the instructions here, using the simple
Python example from SWIG, Windows 7 64-bit and Python 2.7 32-bit, I did not see the OP's specific errors. I saw:
1>example_wrap.obj : error LNK2019: unresolved external symbol "int __cdecl gcd(int,int)" (?gcd@@YAHHH@Z) referenced in function __wrap_gcd
1>example_wrap.obj : error LNK2001: unresolved external symbol "double Foo" (?Foo@@3NA)
Two changes had to be made due to the simple
example being C source instead of C++:
- Do not use the
-c++
switch on the swig
command line (step 13 of the instructions).
- The generated file is now
example_wrap.c
not example_wrap.cxx
(referred to in steps 14 and 19 of the instructions).
Alternatively, just rename example.c
to example.cpp
in this case before following the instructions and they should work as is.