Mapscript compile error
Frank Warmerdam
warmerdam at POBOX.COM
Wed Feb 7 10:08:36 PST 2007
Hans Wapenaar wrote:
> âJava_edu_umn_gis_mapscript_mapscriptJNI_msIO_1getStdoutBufferBytesâ:
> mapscript_wrap.c:34723: warning: pointer targets in passing argument 2 of
> âSWIG_JavaArrayOutScharâ differ in signedness
> gcc -fpic -shared mapscript_wrap.o -o libmapscript.so -L../.. -lmap -
> L/opt/FWTools-1.2.0/lib -lgd -L/opt/FWTools-1.2.0/lib -lfreetype -
> L/opt/FWTools-1.2.0/lib -lpng -L/opt/FWTools-1.2.0/lib -lz -L/opt/FWTools-
> 1.2.0/lib -lfreetype -L/opt/FWTools-1.2.0/lib -lpng -L/opt/FWTools-1.2.0/lib -
> lz -L/opt/FWTools-1.2.0//lib -lproj -L/lib -lgdal -lpthread -lm
> /usr/bin/ld: cannot find -lmap
> collect2: ld returned 1 exit status
> make: *** [mapscript_so] Error 1
Hans,
The problem is that the Java Mapscript file expects to find the mapserver
library two directories up from the Java mapscript directory. So
"-L../.. -lmap" above does not end up finding the map library.
If you look in the mapscript/java/Makefile you should find a line that looks
like:
LDFLAGS= $(RUNPATHS) -L../.. -lmap $(SUP_LIBS) $(STATIC_LIBS)
Try changing this to:
LDFLAGS= $(RUNPATHS) -L/opt/FWTools-1.2.0/lib -lmap $(SUP_LIBS) $(STATIC_LIBS)
Note that FWTools uses MapServer direct from CVS. If you try to build
Java MapScript from 4.10.0 against the FWTools mapserver core you run a
substantial risk of problems as MapServer CVS diverges from 4.10.0.
Also, FWTools isn't really intended for this kind of use, so it is somewhat
risky at the best of times.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | President OSGeo, http://osgeo.org
More information about the MapServer-users
mailing list