[Mapserver-users] building mapserver in CygWin

MattLynch at acm.org MattLynch at acm.org
Tue Dec 3 18:07:47 EST 2002


Hi

I am trying to compile mapserver in the CygWin environment (on a Win 2000 Adv Server machine).

I am using GD 2.0.7 and mapserver 3.6.3

GD compiles and installs successfully, however the mapserver compile gives me an error saying there is an undefined reference to ___gxx_personality_v0.

below is a section of the compile message
----------------------------------------------------------------------------------------------
gcc -c -O2  -Wall -DIGNORE_MISSING_DATA  -DUSE_EPPL    -DUSE_TIFF -DUSE_JPEG -DU
SE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT        -I/home/MattLynch/proje
cts/mapserver-3.6.3/../gd-2.0.7              shp2img.c -o shp2img.o
gcc -O2  -Wall -DIGNORE_MISSING_DATA  -DUSE_EPPL    -DUSE_TIFF -DUSE_JPEG -DUSE_
GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT        -I/home/MattLynch/projects
/mapserver-3.6.3/../gd-2.0.7              shp2img.o  -L. -lmap -L/home/MattLynch
/projects/mapserver-3.6.3/../gd-2.0.7/.libs -lgd -ljpeg  -L/lib -lpng -L/lib -lz
  -ltiff -ljpeg  -L/lib -lpng -L/lib -lz  -ljpeg          -lm   -o shp2img
./libmap.a(mapogr.o)(.eh_frame+0x11):mapogr.cpp: undefined reference to `___gxx_
personality_v0'
Info: resolving _gdFontTiny by linking to __imp__gdFontTiny (auto-import)
Info: resolving _gdFontSmall by linking to __imp__gdFontSmall (auto-import)
Info: resolving _gdFontMediumBold by linking to __imp__gdFontMediumBold (auto-im
port)
Info: resolving _gdFontLarge by linking to __imp__gdFontLarge (auto-import)
Info: resolving _gdFontGiant by linking to __imp__gdFontGiant (auto-import)
collect2: ld returned 1 exit status
make: *** [shp2img] Error 1
----------------------------------------------------------------------------------------------

my makefile is as follows
----------------------------------------------------------------------------------------------
# Run ./configure in the main MapServer directory to turn this Makefile.in
# into a proper Makefile

LIB_INSTALL=/usr/local/lib/
HEADER_INSTALL=/usr/local/include/mapserver-3.5/

#
# mpatrol runtime memory debugger
#
MPATROL=  	
MPATROL_INC=	
MPATROL_LIB=	

#
# If you want to ignore missing datafile errors uncomment the following
# line. This is especially useful with large tiled datasets that may not
# have complete data for each tile.
#
#IGNORE_MISSING_DATA=-DIGNORE_MISSING_DATA
IGNORE_MISSING_DATA = -DIGNORE_MISSING_DATA

#
# Apparently these aren't as commonplace as I'd hoped. Edit the
# following line to reflect the missing functions on your platform.
#
# STRINGS=-DNEED_STRCASECMP -DNEED_STRNCASECMP -DNEED_STRDUP
STRINGS= 

# Proj.4 distribution (cartographic projection routines). Not required for normal use. (EXPERIMENTAL)
PROJ_INC= 
PROJ_LIB= 
PROJ=     

# GD distribution (graphics library GIF and/or PNG support). (REQUIRED)
#
#   - Versions 1.3 to 1.5 write non-LZW GIF (-DUSE_GD_1_3).
#   - Versions 1.6 and greater write PNG (-DUSE_GD_1_6). Add -lpng -lz to GD_LIB line.
#
#
GDFONT_OBJ=gd-1.2/gdfontt.o gd-1.2/gdfonts.o gd-1.2/gdfontmb.o gd-1.2/gdfontl.o gd-1.2/gdfontg.o
GD_INC=  -I/home/MattLynch/projects/mapserver-3.6.3/../gd-2.0.7
GD_LIB=  -L/home/MattLynch/projects/mapserver-3.6.3/../gd-2.0.7/.libs -lgd -ljpeg  -L/lib -lpng -L/lib -lz
GD=       -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT
GD_STATIC = 

# PDFlib distribution (PDF library w/ PDF support). (EXPERIMENTAL)
#
#
#
PDF_INC=  
PDF_LIB=  
PDF=      
PDF_OBJ=  

# TIFF distribution (raster support for TIFF and GEOTIFF imagery). (RECOMMENDED)
TIFF_INC= 
TIFF_LIB= -ltiff -ljpeg  -L/lib -lpng -L/lib -lz
TIFF=     -DUSE_TIFF

# JPEG distribution (raster support for grayscale JPEG images, INPUT ONLY).
JPEG_INC= 
JPEG_LIB= -ljpeg
JPEG=     -DUSE_JPEG

# EPPL7 Support (this activates ERDAS as well) Included in the distribution. Probably the best raster alternative if
# you've got EPPL7 laying around. See http://www.lmic.state.mn.us/ for more information. (RECOMMENDED)
EPPL=     -DUSE_EPPL
EPPL_OBJ= epplib.o

# ESRI SDE Support. You MUST have the SDE Client libraries and include files
# on your system someplace. The actual SDE server you wish to connect to can
# be elsewhere.
SDE=	  
SDE_LIB=  
SDE_INC=  

# Optional OGR Support.  OGC Simple Feature inspired interface for vector
# formats.  See http://gdal.velocet.ca/projects/opengis/
OGR=	  
OGR_LIB=  
OGR_INC=  
OGR_STATIC= 

# Optional GDAL Support (provides read access to a variety of raster formats)
# See http://www.remotesensing.org/gdal
GDAL=	  
GDAL_LIB=  
GDAL_INC=  

# Optional PostGIS Support.  See http://postgis.refractions.net/
POSTGIS=      
POSTGIS_LIB=  
POSTGIS_INC=  

# Optional ORACLESPATIAL Support. Contact: cabral at cttmar.univali.br
ORACLESPATIAL=      
ORACLESPATIAL_LIB=  
ORACLESPATIAL_INC=  

# w3c-libwww ... required for WMS Client Connections
WWW_INC= 
WWW_LIB= 

# OGC WMS Compatibility:  -DUSE_WMS (Requires PROJ4 support)
# OGC WMS Client Connections:  -DUSE_WMS_LYR (Requires PROJ4 and libwww)
WMS=	   

#
# UofMN GIS/Image Processing Extension (very experimental)
#
#EGIS=-DUSE_EGIS
#EGIS_INC=-I./egis/errLog -I./egis/imgSrc -I./egis
#EGIS_LIB=-L./egis/errLog -lerrLog -L./egis/imgSrc -limgGEN -L./egis -legis
#MAKE_EGIS=egis
#MAKE_EGIS_CLEAN=egis_clean

#
# IMPORTANT NOTE ABOUT REGEX FOR PHP_MAPSCRIPT USERS:
#
# In order to compile the PHP_MAPSCRIPT module, we have to make MapServer
# uses the same version of the REGEX library that PHP was compiled with:
#
REGEX_OBJ=	
REGEX_INC=	

#
# Multithreading support.
#
THREAD=
THREAD_LIB=

#
# Pick a compiler, etc. Flex and bison are only required if you need to modify the mapserver lexer (maplexer.l) or expression parser (mapparser.y).
#
CXX=	g++
CC=     gcc
AR= ar rc
RANLIB= ranlib
LEX=    flex
YACC=   bison -y

XTRALIBS=  -lm
RUNPATHS= 

CFLAGS= -O2  -Wall  \
        $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL) $(PROJ) $(WMS) \
	$(ORACLESPATIAL) $(TIFF) $(JPEG) $(GD) $(PDF) $(SDE) $(OGR) $(GDAL) \
	$(POSTGIS) $(MPATROL) $(THREAD) \
	$(GD_INC) $(PDF_INC) $(PROJ_INC) $(TIFF_INC) $(JPEG_INC) $(EGIS_INC) $(SDE_INC) \
	$(REGEX_INC) $(MPATROL_INC) $(OGR_INC) $(GDAL_INC) $(POSTGIS_INC) \
	$(WWW_INC) $(ORACLESPATIAL_INC)

# Link flags and shared libs only
LDFLAGS=  $(RUNPATHS) -L. -lmap $(GD_LIB) $(PDF_LIB) $(TIFF_LIB) $(PROJ_LIB) \
          $(JPEG_LIB) $(EGIS_LIB) $(SDE_LIB) $(OGR_LIB) $(GDAL_LIB) \
	  $(POSTGIS_LIB) $(WWW_LIB) $(ORACLESPATIAL_LIB) $(MPATROL_LIB) \
	  $(THREAD_LIB) $(XTRALIBS)

# STATIC_LIBS is full filename with path of libs that will be statically linked
STATIC_LIBS= $(GD_STATIC) $(OGR_STATIC)

RM= /bin/rm -f

OBJS= maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o $(EPPL_OBJ) $(REGEX_OBJ) $(PDF_OBJ)

#
# --- You shouldn't have to edit anything else. ---
#
.c.o:
	$(CC) -c $(CFLAGS) $< -o $@

all: $(MAKE_GD) $(MAKE_EGIS) libmap.a shp2img shp2pdf legend \
	mapserv shptree shptreevis shptreetst scalebar sortshp perlvars \
	tile4ms 

egis::
	cd egis/errLog; make; cd ..
	cd egis/imgSrc; make; cd ..
	cd egis; make; cd ..

php3_mapscript:: libmap.a
	cd mapscript/php3; $(MAKE); cd ../..

maplexer.o: maplexer.c map.h mapfile.h

maplexer.c: maplexer.l
	$(LEX) -Pmsyy -i -omaplexer.c maplexer.l

mapparser.o: mapparser.c map.h

mapparser.c: mapparser.y
	$(YACC) -p msyy -d -omapparser.c mapparser.y

mapogr.o: mapogr.cpp
	$(CXX) -c $(CFLAGS) mapogr.cpp -o mapogr.o

lib: libmap.a
libmap: libmap.a
libmap.a: map.h $(OBJS) map.h
	$(AR) libmap.a $(OBJS)
	$(RANLIB) libmap.a

shp2pdf: libmap.a shp2pdf.o map.h
	$(CC) $(CFLAGS) shp2pdf.o $(LDFLAGS) $(STATIC_LIBS) -o shp2pdf

shp2img: libmap.a  shp2img.o map.h
	$(CC) $(CFLAGS) shp2img.o $(LDFLAGS) $(STATIC_LIBS) -o shp2img

sym2img: libmap.a   sym2img.o map.h
	$(CC) $(CFLAGS) sym2img.o $(LDFLAGS) $(STATIC_LIBS) -o sym2img

legend: libmap.a  legend.o map.h
	$(CC) $(CFLAGS) legend.o $(LDFLAGS) $(STATIC_LIBS) -o legend

scalebar: libmap.a  scalebar.o map.h
	$(CC) $(CFLAGS) scalebar.o $(LDFLAGS) $(STATIC_LIBS) -o scalebar

mapserv: mapserv.h libmap.a  mapserv.o cgiutil.o map.h
	$(CC) $(CFLAGS) mapserv.o cgiutil.o  $(LDFLAGS) $(STATIC_LIBS) -o mapserv

shpindex: libmap.a shpindex.o map.h
	$(CC) $(CFLAGS) shpindex.o $(LDFLAGS) $(STATIC_LIBS) -o shpindex

shptree: libmap.a shptree.o map.h
	$(CC) $(CFLAGS) shptree.o $(LDFLAGS) $(STATIC_LIBS) -o shptree

shptreevis: libmap.a shptreevis.o map.h
	$(CC) $(CFLAGS) shptreevis.o $(LDFLAGS) $(STATIC_LIBS) -o shptreevis

shptreetst: libmap.a shptreetst.o map.h
	$(CC) $(CFLAGS) shptreetst.o $(LDFLAGS) $(STATIC_LIBS) -o shptreetst

sortshp: sortshp.o
	$(CC) $(CFLAGS) sortshp.o $(LDFLAGS) $(STATIC_LIBS) -o sortshp

tile4ms: tile4ms.o
	$(CC) $(CFLAGS) tile4ms.o $(LDFLAGS) $(STATIC_LIBS) -o tile4ms

perlvars:
	touch perlvars
	pwd > perlvars
	echo $(IGNORE_MISSING_DATA) $(STRINGS) $(EPPL) $(PROJ) $(TTF) $(TIFF) $(JPEG) $(GD) $(SDE) $(OGR) $(GDAL) >> perlvars
	echo -I. $(PROJ_INC) $(GD_INC) $(TTF_INC) $(TIFF_INC) $(JPEG_INC) $(SDE_INC) $(OGR_INC) $(GDAL_INC) >> perlvars
	echo $(LDFLAGS) >> perlvars
	echo $(STATIC_LIBS) >> perlvars

egis_clean:
	cd egis/errLog; $(MAKE) clean; cd ..
	cd egis/imgSrc; $(MAKE) clean; cd ..
	cd egis; $(MAKE) clean; cd ..

php3_mapscript_clean::
	cd mapscript/php3; $(MAKE) clean; cd ../..

install: libmap.a
	cp -f libmap.a $(LIB_INSTALL)
	cp -f map.h $(HEADER_INSTALL)

clean:	$(MAKE_EGIS_CLEAN) 
	rm -f libmap.a *.o shp2img shp2pdf mapserv legend shptree shptreevis shptreetst scalebar sortshp perlvars

distclean:
	$(MAKE) clean
	rm config.*

sorta-clean:
	rm -f *.o
----------------------------------------------------------------------------------------------

I have performed the following steps to get to where I have the error message:
----------------------------------------------------------------------------------------------
aclocal
./configure --with-gd=../gd-2.0.7
make
----------------------------------------------------------------------------------------------


any suggestions?

Thanks,

Matt




More information about the mapserver-users mailing list