[Gdal-dev] Problem compiling Mapserver against GDAL with ECW sdk undefined references - Corrected

Frank Warmerdam warmerdam at pobox.com
Wed Nov 2 10:28:25 EST 2005


On 11/1/05, James Browne <James.Browne at liu.edu> wrote:
> Hi all,
>
>    Sorry to post this again, but I just discovered that the last attempt was altered before you saw it.
>
>    Usually an undefined reference  is from a library path problem or version problem with header files. I think that I have double checked for these mistakes. GDAL command line utilities find the new ECW libraries and they seem to find each other. Trying gdal-config --libs returns the expected value, dalinfo reads ECW files, gdalwarp converts from ECW, and gdal-translate doesn't crash.
>
>    But when I compile Mapserver 4.6.1 against GDAL 1.3.1 library that uses the latest source for ECW SDK 3.3, making sure to use the path to gdal-config, and even try adjusting mapserver's --prefix --libdir configure options, I still get the following errors (abbreviated from a long series)
>
>
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `NCSDeleteFile'
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `NCSGetTempFileName'
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `NCSUtilInit'
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `NCSRemoveDir'
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `CNCSEvent::Set()'
> /usr/lib/libgdal.so: undefined reference to `CNCSThread::Resume()'
> /usr/bin/../lib/libNCSEcw.so: undefined reference to `NCSByteSwapRange64'
> /usr/lib/libgdal.so: undefined reference to `CNCSThread::GetStats()'
> /usr/lib/libgdal.so: undefined reference to `CNCSThread::GetPriority()'
> ...
> etc.

Jim,

I don't see what platform you are on.

It looks like you will need to explicitely link against libNCSUtil.so
which is where these functions (at least some) are defined.

If you hand edit the MapServer Makefile, try adding -lNCSUtil
after -lgdal.  I find it odd that GDAL utilities work but MapServer
does not.  This might be because GDAL's build is picking up
dependency information about libNCSEcw.so from the libtool
created .la file while MapServer does not do this since it does
not use libtool.

I haven't run into this problem on Linux where I think the installed
libNCSEcw.so should have good built-in dependency information.
Perhaps you are on a non-linux platform?  MacOS X?   I have had
some weird problems with dependencies on MacOS X in the past.

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    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list