I've just followed the exact same steps and I still get the error. I will try it with Python 2.6 tomorrow and if that doesn't work that only really leaves some Visual Studio 2010 problem. Meh.

Thanks for the help so far.

On 28 May 2012 17:14, Bob Hood <bhood2@comcast.net> wrote:
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 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:
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
   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                                 ^(===)^
    I'm not so good with advice...can I interest you in a sarcastic comment?

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Swig-user mailing list