Opened 12 years ago

Last modified 12 years ago

#4098 new defect

Compile Error in mapserver-6.0.1 in mapogr.cpp

Reported by: mpettis Owned by: sdlime
Priority: normal Milestone:
Component: MapServer C Library Version: unspecified
Severity: normal Keywords: mapogr.cpp
Cc: tbonfort, warmerdam

Description

Trying to compile under Ubuntu 8.04 LTS. configure script passed, but get error at bottom during make/compile.

Thanks, Matt

g++ -c -O2 -fPIC -Wall  -DNDEBUG    -DHAVE_VSNPRINTF -DNEED_STRLCPY -DNEED_STRLCAT -DNEED_STRRSTR     -DUSE_FASTCGI         -DUSE_LIBXML2    -DUSE_WFS_SVR -DUSE_WMS_SVR   -DUSE_POSTGIS -DPOSTGIS_HAS_SERVER_VERSION  -DUSE_OGR   -DUSE_PROJ    -DUSE_GD_GIF -DUSE_GD_PNG -DUSE_GD_JPEG -DUSE_GD_WBMP -DUSE_GD_FT -DGD_HAS_FTEX_XSHOW -DGD_HAS_GDIMAGEGIFPTR -DGD_HAS_GETBITMAPFONTS -DGD_HAS_GET_TRUE_COLOR_PIXEL -DUSE_ICONV -DUSE_GIF -DUSE_PNG -DUSE_ZLIB -DUSE_FREETYPE   -DDISABLE_CVSID -I/usr/include/freetype2     -I/usr//include -Irenderers/agg/include   -I/usr//include   -I/usr/include/gdal -I/usr/include/postgresql      -I/usr/include -I/usr/include/fastcgi  -I/usr/include/libxml2   mapogr.cpp -o mapogr.o 
mapogr.cpp:3215:46: error: macro "MS_INIT_COLOR" requires 5 arguments, but only 4 given 
mapogr.cpp:3221:50: error: macro "MS_INIT_COLOR" requires 5 arguments, but only 4 given 
mapogr.cpp: In function 'int msOGRUpdateStyle(OGRStyleMgr*, mapObj*, layerObj*, classObj*)': 
mapogr.cpp:3053: error: 'struct labelObj' has no member named 'backgroundcolor' 
mapogr.cpp:3053: error: 'struct labelObj' has no member named 'backgroundcolor' 
mapogr.cpp:3053: error: 'struct labelObj' has no member named 'backgroundcolor' 
mapogr.cpp:3053: error: 'struct labelObj' has no member named 'backgroundcolor' 
mapogr.cpp:3053: error: 'struct labelObj' has no member named 'backgroundcolor' 
mapogr.cpp:3215: error: 'MS_INIT_COLOR' was not declared in this scope 
make: *** [mapogr.o] Error 1

Change History (4)

comment:1 by tbonfort, 12 years ago

Cc: tbonfort added

comment:2 by warmerdam, 12 years ago

Cc: warmerdam added

This does not precisely look like a GDAL/OGR version issue to me since the missing field is in labelObj. Instead it seems like the OGR C++ API code has not been kept up to date with changes in mapserver.h to things like labelObj.

Matt, are you using a GDAL/OGR older than 1.5.0? Hmm, Ubuntu 8.04 - I can easily imagine this being fairly ancient.

It is my opinion that MapServer should now require GDAL 1.5.0 or newer and that we ought to remove all the OGR C++ API cruft - at least in trunk. Matt could likely revert to an older version of MapServer or alternatively try to install a newer GDAL and use it in preference to the system one.

comment:3 by sdlime, 12 years ago

Frank is right and it seems like the OGR C++ API code has not been kept up to date with changes in mapserver.h - at least in a certain section. When I made those changes to the labelObj I used a kitchen sink build to find hidden occurrences. I can edit mapogr.cpp and provide a patch if Matt doesn't want to upgrade.

It might make more sense to set a minimum GDAL/OGR version supported and remove some bits of code like this.

Steve

comment:4 by mpettis, 12 years ago

I did upgrade, I was at version 1.4 for gdal/ogr, but thanks for the offer.

Note: See TracTickets for help on using tickets.