On 5/28/2012 9:50 AM, Douglas Russell wrote:
In VS10, File -> Open Project/Solution.
Browse to swigwin-2.0.7/Examples/python/simple and select the VC++6 Project.
Allow it to convert to VS10

Did this (I use VS2008).


There is then a little tweaking to do (I do it on the config properties for "Release" and then set the mode to that in the main window so I don't get complaints about a missing Python32_d):

Yes, adjusted my project settings thus:

For "All Configurations", I replaced $(PYTHON_INCLUDE) in "C/C++:General:Additional Include Directories" with my literal path "M:\HG\trunk\SDK\Python_32_dll\Include".

For "Release", I replaced "$(PYTHON_LIB)" in "Linker:Input:Additional Dependencies" with my literal path "M:\HG\trunk\SDK\Python_32_dll\python27.lib".

Right Click example.i -> Properties -> Configuration Properties ->Custom Build Tool -> General -> Command Line: This needs to be fixed so it points at your swig executable and possibly also to quote the path argument if yours contains spaces.

I corrected this so it looks like:
echo In order to function correctly, please ensure the following environment variables are correctly set:
echo PYTHON_INCLUDE: %PYTHON_INCLUDE%
echo PYTHON_LIB: %PYTHON_LIB%
echo on
set SWIG_LIB=M:\HG\trunk\SDK\swig-2.0.4\Lib
M:\HG\trunk\SDK\swig-2.0.4\swig.exe -python $(InputPath)


(Note that I added a setting for the SWIG_LIB environment variable so SWIG can find its support files.)

My build succeeded:
------ Build started: Project: example, Configuration: Release Win32 ------
Performing Custom Build Step
In order to function correctly, please ensure the following environment variables are correctly set:
PYTHON_INCLUDE:
PYTHON_LIB:
M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple>set SWIG_LIB=M:\HG\trunk\SDK\swig-2.0.4\Lib
M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple>M:\HG\trunk\SDK\swig-2.0.4\swig.exe -python M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple\example.i
M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple>if errorlevel 1 goto VCReportError
M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple>goto VCEnd
Compiling...
example_wrap.c
example.c
Linking...
   Creating library .\Release/_example.lib and object .\Release/_example.exp
Embedding manifest...
Build log was saved at "file://M:\HG\trunk\SDK\swig-2.0.4\Examples\python\simple\Release\BuildLog.htm"
example - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


Hopefully, there's something in here that will fix your issue.

Render me gone,                       |||
Bob                                 ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
    I'm not so good with advice...can I interest you in a sarcastic comment?