You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Bill Janssen <ja...@parc.com> on 2010/10/05 20:43:50 UTC

Can't build 3.0.2 with gcc 4.5 and mingw/msys on Windows XP

I'm trying to build JCC 2.6 (from the PyLucene 3.0.2 source bundle) with
GCC 4.5 on Windows XP using MinGW/msys.

creating build\temp.win32-2.6\Release\jcc\sources
c:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_jcc_lib -DJCC_VER="2.6" "-IC:\Program Files\Java\jdk1.6.0_21\include" "-IC:\Program Files\Java\jdk1.6.0_21\include\win32" -I_jcc -Ijcc/sources -Ic:\Python26\include -Ic:\Python26\PC -c jcc/sources/jcc.cpp -o build\temp.win32-2.6\Release\jcc\sources\jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
jcc/sources/jcc.cpp: In function 'PyObject* initJCC(PyObject*)':
jcc/sources/jcc.cpp:337:48: error: cannot convert 'double' to 'const char*' for argument '1' to 'PyObject* PyString_FromString(const char*)'
error: command 'gcc' failed with exit status 1

I believe the #ifdef a few lines above needs to change from

#ifdef _MSC_VER

to

#if defined(_MSC_VER) || defined(__WIN32)

to match the similar #ifdefs elsewhere in the code.

JCC_VER is a double on Windows but a string elsewhere?  Odd.

Bill

Re: Can't build 3.0.2 with gcc 4.5 and mingw/msys on Windows XP

Posted by Andi Vajda <va...@apache.org>.
On Tue, 5 Oct 2010, Bill Janssen wrote:

> I'm trying to build JCC 2.6 (from the PyLucene 3.0.2 source bundle) with
> GCC 4.5 on Windows XP using MinGW/msys.
>
> creating build\temp.win32-2.6\Release\jcc\sources
> c:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -D_jcc_lib -DJCC_VER="2.6" "-IC:\Program Files\Java\jdk1.6.0_21\include" "-IC:\Program Files\Java\jdk1.6.0_21\include\win32" -I_jcc -Ijcc/sources -Ic:\Python26\include -Ic:\Python26\PC -c jcc/sources/jcc.cpp -o build\temp.win32-2.6\Release\jcc\sources\jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
> jcc/sources/jcc.cpp: In function 'PyObject* initJCC(PyObject*)':
> jcc/sources/jcc.cpp:337:48: error: cannot convert 'double' to 'const char*' for argument '1' to 'PyObject* PyString_FromString(const char*)'
> error: command 'gcc' failed with exit status 1
>
> I believe the #ifdef a few lines above needs to change from
>
> #ifdef _MSC_VER
>
> to
>
> #if defined(_MSC_VER) || defined(__WIN32)
>
> to match the similar #ifdefs elsewhere in the code.
>
> JCC_VER is a double on Windows but a string elsewhere?  Odd.

Probably because it lost "" somewhere like where the compiler 
was invoked from. -Dfoo=1.2 instead of -Dfoo="1.2".
The verstring macro in the conditional you found fixes this.

As you suggest, it should have the extra check for __WIN32 like elsewhere.

Thanks !

Andi..