473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

swig win32 scons

Hello,

I spent the morning figuring out how to use SWIG on Microsoft Windows.
I compiled the example from the SWIG tutorial on http://www.swig.org.
The biggest stumbling block was not knowing that I needed to rename
the DLL created to have a PYD extension. I also ended up writing
a .def file for exporting functions from the DLL.

Here is my SConstruct file for using SCons to build the library. It is
not perfect, but it should be evident as to what I was doing. I hope
that others will be able to find this in the future and save
themselves some time.:
##############################
SWIG_EXE = r'C:\Python25\swig\swig.exe'
env = Environment(SWIG=SWIG_EXE,
SWIGFLAGS=['-python'],
CPPPATH=[r'C:\Python25\include'],
LIBPATH=[r'C:\Python25\libs'])
swigObject = env.SharedObject(['example.i'])
copyToPYD = Copy('_example.pyd', '_example.dll')
env.AddPostAction('_example.dll', copyToPYD)
env.SharedLibrary('_example.dll', ['example.c', swigObject])

Apr 16 '07 #1
1 3119
It turns out I didn't need the DEF file for exports.

Apr 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil Schmidt | last post by:
I'm attempting to follow the instructions at http://sebsauvage.net/python/mingw.html, without luck. I have Python 2.3, MinGW 3.2.3, ans SWIG 1.3.19. I get an export error on "initexample" when...
0
by: Jon Moldover | last post by:
Hi, I'm using Python in my win32 app by linking to the python23.dll. I'm trying to expose some c++ code in my app to Python so I can make application calls from Python scripts (according to the...
8
by: ted | last post by:
How does the speed of the Scons build tool compare with Ant? Right now with out Ant builds take around an hour. Hoping to speed that up. TIA, Ted
3
by: corey.coughlin | last post by:
Hey guys, here's a little question. I'm looking for something like a build system, where I can set up a bunch of jobs with dependencies, and have them run in parallel. Ideally, I'd like a system...
0
by: ReaprZero | last post by:
Hi, I'm using Cygwin and ActiveState perl to try to compile a sample application using SWIG. I'm using the short tutorial from http://www.swig.org/tutorial.html (the perl part of it), but with a...
0
by: mauro | last post by:
Hi all, I am trying to make a package distribution containing some extension module written in C. The problem is that when I run setup.py some files are generated in the wrong position. Suppose...
0
by: newbie73 | last post by:
Going through the tutorial on http://swig.org, I created the example files (pasted below). After generating the _wrap file, I tried compiling (using mingw32) and received a lot of undefined...
0
by: gamename | last post by:
Hi, I just installed scons on win32 that has cygwin but uses ActiveState python. If I do "import SCons", the lib isn't found. The win32 installer seemed very complete, but the scons lib doesn't...
1
by: anush | last post by:
Can anybody tell how I could go about running python scripts with scons.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.