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

James Browne James.Browne at liu.edu
Wed Nov 2 15:30:19 EST 2005


Frank,

   Thanks for the tip. It worked - partially. I am running a twin Zeon Debian Linux box. I may have messed something up while trying to get this to work over the past 4 months, but can't figure out what. Mapserver compiled, but when I use it, the resulting page reads:

Warning: dl(): Unable to load dynamic library '/usr/lib/php4/20020429/php_mapscript.so' - libNCSEcw.so: cannot open shared object file: No such file or directory in /var/www/envir_anal/enviro.php on line 8

Fatal error: Call to undefined function: ms_newmapobj() in /var/www/envir_anal/enviro.php on line 15




   If I create symbolic links from /usr/lib/libNCS... to /the respective /usr/local/lib/libNCS... files, I then get:

Warning: dl(): Unable to load dynamic library '/usr/lib/php4/20020429/php_mapscript.so' - /usr/lib/libNCSEcw.so: undefined symbol: _ZN10CNCSThread5SpawnEPvb in /var/www/envir_anal/enviro.php on line 8

Fatal error: Call to undefined function: ms_newmapobj() in /var/www/envir_anal/enviro.php on line 15



   It seems Mapserver expects the files in /usr/lib but still doesn't see inside them when there. Is there, or should there be, something like a -DUSE_ECW?

   These problems don't make sense to me either, if they did, it would be easy to fix. 


   Thanks again,

                   Jim


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

 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 4721 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051102/65c6b98f/attachment.bin


More information about the Gdal-dev mailing list