Wednesday, October 22, 2008

 

compile python 2.5 cjson 1.0.5 in Windows XP

If you're trying to build cjson in Windows XP you might have seen this bug (in addition to the usual setuptools package, you'll need the mingw compiler):


C:\Python25\python-cjson-1.0.5>python setup.py build
running build
running build_ext
building 'cjson' extension
creating build\temp.win32-2.5
creating build\temp.win32-2.5\Release
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DMODULE_VERSION="1.0.5" -IC:\Py
thon25\include -IC:\Python25\PC -c cjson.c -o build\temp.win32-2.5\Release\cjson
.o
cjson.c:1153:50: too many decimal points in number
error: command 'gcc' failed with exit status 1


I worked around this bug by changing the MODULE_VERSION token on line 1153 of cjson.c to "1.0.5" (in quotes). Now "python setup.py install" works and the resulting modules passes the jsontests.py


Comments:
Awesome. Just had the same problem and this fix worked.

Thanks!
 
Just had this problem. Thanks for posting this workaround! You just made my day. :)
 
Thank you. It was just you wrote it!
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?