[Freeassociation-devel] Building Python Bindings on Windows

Mark Bucciarelli mark at hubcapconsulting.com
Sat Nov 15 12:24:27 PST 2003


I'm trying to get the Python bindings for libical working on Windows.  I can 
import LibicalWrap in the Python interpreter, but when I run the test.py 
program, I get access violation errors.

Below are the steps I followed to get as far as I did.  If anyone has any 
suggestions for possible next steps, please let me know.

1.	Install Cygwin (with Perl, sed, bash)
2.	Check out libical CVS (latest tarball does not have VC++ project files)
3.	Open libical.dsp
4.	Build -> Build libical.lib (stops--VC++ doesn't know about sh)
5.	From cygwin prompt, run a bash script that contains the three calls
	to mkderivedvalues.pl and the call to mkinclude.sh (cut and paste from
	the dsp file).
6.	Back in VC++, run Build -> Build libical.lib.  If it doesn't work, 
	repeat step 5 and retry.

7.	Open libicalss.dsp
8.	Build all

9.	Install swig.
10.	Copy libical.lib, libicalss.lib, ical.h, icalss.h and contents of
	..\libical\src\python directory to a temp directory.
11.	run "swig -python LibicalWrap.i
12.	Copy the swig dsp file from ...\Examples\python\simple
13.	Change output name to _libicalwrap.dll
14.	In Project Settings, C/C++ tab, General Category, change the Project
	Option list to include /MD instead of /MT.  (Or maybe the other 
	way around--all three dsp files must have the same setting--the 
	defaults are the swig is one way and the two libical projects are 
	the other way.)

15.	Enter Python interpreter
		>>>import LibicalWrap
		>>>dir(LibicalWrap)
		>>> ... long list ...
16.	At dos prompt, type python test.py

		Unhandled exception in python.exe (_LIBICALWRAP.DLL): 0xC00000005:
		Access Violation.

I tried commenting out each test and rerunning, and the first six or seven 
tests give the same error.

Regards,

Mark




More information about the libical-devel mailing list