MapServer / MapServer-import

3 stars 2 forks source link

Java mapscript fails to compile #1249

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: unicoletti Date: 2005/02/18 - 08:51

I have checked out mapserver from cvs and I was not able to compile Java mapscript.

These are the configure options:

/configure --with-threads --with-pdf --with-proj --without-tiff --without-wms
--with-gdal=/opt/gdal/bin/gdal-config

And this is the error I get:
unicoletti@friedrich java $ make interface all
mkdir -p edu/umn/gis/mapscript
swig -java -package edu.umn.gis.mapscript -o mapscript_wrap.c ../mapscript.i
mv *.java edu/umn/gis/mapscript/
gcc -fpic -c -O2 -fPIC -Wall -DIGNORE_MISSING_DATA -DNEED_STRLCAT  -DUSE_EPPL
-DUSE_PROJ -DUSE_PROJ_API_H      -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG
-DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS
-DUSE_PDF   -DUSE_GDAL    -DUSE_THREAD -I/usr/include -I/opt/gdal/include     
-I/opt/sun-j2sdk1.4.2_03/include -I/opt/sun-j2sdk1.4.2_03/include/linux
-fno-strict-aliasing mapscript_wrap.c
mapscript_wrap.c: In function `layerObj_applySLD':
mapscript_wrap.c:1324: warning: implicit declaration of function `msSLDApplySLD'
mapscript_wrap.c: In function `layerObj_applySLDURL':
mapscript_wrap.c:1327: warning: implicit declaration of function `msSLDApplySLDURL'
mapscript_wrap.c: In function `layerObj_generateSLD':
mapscript_wrap.c:1330: warning: implicit declaration of function `msSLDGenerateSLD'
mapscript_wrap.c: In function `mapObj_saveQueryAsGML':
mapscript_wrap.c:1525: warning: implicit declaration of function `msGMLWriteQuery'
mapscript_wrap.c: At top level:
mapscript_wrap.c:36765: error: syntax error before "if"
make: *** [mapscript_so] Error 1

It looks the problem lies in the following lines of code (from mapscript.i):
%init %{
        if (msSetup() != MS_SUCCESS)
    {
        msSetError(MS_MISCERR, "Failed to set up threads and font cache",
                   "msSetup()");
    }
%}

They refer to bug 1203.
tbonfort commented 12 years ago

Author: jerry.pisk@gmail.com Date: 2005/02/18 - 18:56

I do have a fix, I was waiting on seang to decide whether he wants to use it 
or pursue single initialization code for all languages. The problem is that 
swig's %init section will not work with Java.
tbonfort commented 12 years ago

Author: sgillies@frii.com Date: 2005/02/18 - 20:27

OK, I moved that %init block within the next #ifdef SWIGPYTHON so that it is
Python only.  Committed to CVS HEAD.
tbonfort commented 12 years ago

Author: unicoletti Date: 2005/02/19 - 11:08

It now compiles fine and I can use it from my java webapp.

Also an issue present in recent cvs checkouts related to gdImageSetThickness
that crashed java mapscript is solved.
tbonfort commented 12 years ago

Author: sdlime Date: 2005/02/19 - 15:16

Marking as fixed for now...