Opened 20 years ago

Closed 20 years ago

#632 closed defect (fixed)

Symbol collisions between postgis and mygis

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone: 4.4 release
Component: PostGIS Interface Version: 4.1
Severity: normal Keywords:
Cc: bear@…, dblasby@…

Description

Helder De Pauw wrote:

Hi,

I tried to compile mapserver 4.0.2 with mygis support. I did as configure :

./configure --with-jpeg=/usr/local --with-freetype=/usr/local
--with-zlib=/usr/lib --with-tiff=/usr/local --with-png=/usr/local
--with-proj=/usr/local --with-gdal=/usr/local/bin/gdal-config
--with-gd=/usr/local --without-pdf --with-eppl --with-httpd=/usr/sbin/httpd
--with-postgis=/usr/local/pgsql/bin/pg_config
--with-mygis=/usr/local/bin/mysql_config

The configuration gave no errors but the make gave following errors :

./libmap.a(mapmygis.o)(.text+0x0): In function `DATAERRORMESSAGE':
: multiple definition of `DATAERRORMESSAGE'
./libmap.a(mappostgis.o)(.text+0x1ac): first defined here
/usr/bin/ld: Warning: size of symbol `DATAERRORMESSAGE' changed from 169 to 367
in ./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0x81c): In function `prep_DB':
: multiple definition of `prep_DB'
./libmap.a(mappostgis.o)(.text+0x48c): first defined here
/usr/bin/ld: Warning: size of symbol `prep_DB' changed from 1330 to 1118 in
./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0xe08): In function `force_to_points':
: multiple definition of `force_to_points'
./libmap.a(mappostgis.o)(.text+0xcec): first defined here
/usr/bin/ld: Warning: size of symbol `force_to_points' changed from 543 to 558
in ./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0x1038): In function `force_to_lines':
: multiple definition of `force_to_lines'
./libmap.a(mappostgis.o)(.text+0x! f0c): first defined here
/usr/bin/ld: Warning: size of symbol `force_to_lines' changed from 428 to 438 in
./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0x11f0): In function `force_to_polygons':
: multiple definition of `force_to_polygons'
./libmap.a(mappostgis.o)(.text+0x10b8): first defined here
/usr/bin/ld: Warning: size of symbol `force_to_polygons' changed from 260 to 416
in ./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0x1390): In function `dont_force':
: multiple definition of `dont_force'
./libmap.a(mappostgis.o)(.text+0x11bc): first defined here
/usr/bin/ld: Warning: size of symbol `dont_force' changed from 155 to 218 in
./libmap.a(mapmygis.o)
./libmap.a(mapmygis.o)(.text+0x1b64): In function `find_bounds':
: multiple definition of `find_bounds'
./libmap.a(mappostgis.o)(.text+0x1258): first defined here
./libmap.a(mapmygis.o)(.text+0x66f): In function `msMYGISLayerOpen':
: undefined reference to `mysql_connect'collect2: ld returned 1 exit status
make: *** [shp2img] Error 1

Can somebody give me a clue how to fix these ?

Change History (6)

comment:1 by dmorissette, 20 years ago

Milestone: 4.2 release
Attila wrote:

It seems that the postgis and mygis modules use the same function names and 
this causes a compilation error when you try to make a binary that supports 
both. This is obviously a bug regarding namespace clashes, I'm afraid there 
is no easy fix other than excluding one of them or waiting for the correction 
to make it into CVS.

comment:2 by dmorissette, 20 years ago

The functions should be made static in both files, or the names changed. Since
you wrote the mygis extension (I believe), could you please fix that Attila in
both the 4.2 branch (branch-4-2) and the main CVS trunk? 

(I'm not setup to test mygis so it would be unsafe for me to make that change)

comment:3 by dmorissette, 20 years ago

Merlos wrote:
> Hello Daniel
> 
> I added the static reserved word  and it worked, at least, it compiled. I 
> haven't tested if it does not give any problems when using it for getting 
> data from the database, but it compiled.
> 
> The functions I modified in both files where:
> 
> DATAERRORMESSAGE()
> prep_DB()
> force_to_points()
> force_to_lines()
> force_to_polygons()
> dont_force()
> find_bounds()
> 

comment:4 by dmorissette, 20 years ago

Milestone: 4.2 release4.4 release

comment:5 by dmorissette, 20 years ago

Cc: bear@… added
Owner: changed from bear@… to morissette@…
Reassigned to myself. I'll change the functions in comment#3 to static.

comment:6 by dmorissette, 20 years ago

Resolution: fixed
Status: newclosed
Fixed (untested) in 4.3 CVS by making all the functions above static.
Note: See TracTickets for help on using tickets.