[Gdal-dev] 1.2.0a Release

Daniel Morissette dmorissette at dmsolutions.ca
Thu Feb 19 19:00:47 EST 2004


Frank Warmerdam wrote:
> I would appreciate it if some people could give this new rev a quick 
> spin on
> different platforms, and building it into different applications.  
> 


Trying to build on Solaris 8, using GCC 2.95.2, I get the following errors:

---------------------
/bin/sh ../libtool --mode=compile g++ -Wall  -O2   -I../port  -c -o 
cpl_vsisimple.o cpl_vsisimple.cpp
  g++ -Wall -O2 -I../port -c cpl_vsisimple.cpp  -fPIC -DPIC -o 
.libs/cpl_vsisimple.o
cpl_vsisimple.cpp: In function `struct tm * VSIGMTime(const time_t *, tm 
*)':
cpl_vsisimple.cpp:445: implicit declaration of function `int gmtime_r(...)'
cpl_vsisimple.cpp: In function `struct tm * VSILocalTime(const time_t *, 
tm *)':
cpl_vsisimple.cpp:463: implicit declaration of function `int 
localtime_r(...)'
make: *** [cpl_vsisimple.o] Error 1

---------------------


The function gmtime_r() is available in <time.h>, but for some reason 
the prototype is not found (it is protected by a few #ifdefs in time.h).

The Solaris man pages talk about defining _POSIX_C_SOURCE to a value >= 
199506L.  I tried that but then started getting problems with strdup() 
in cpl_vsisimple.cpp.  Looking in <string.h> it seems that this function 
isn't available when _POSIX_C_SOURCE is defined.

OK. To make a long story short, I have removed HAVE_GMTIME_R and 
HAVE_LOCALTIME_R in cpl_config.h and my compilation continues.

What should we do about this?  Should we put a test specific to Solaris 
in configure?  Is this a problem that could apply to other platforms?  I 
have to admit that I'm not familiar with this _POSIX_C_SOURCE define.

BTW, we'll be probably compiling on AIX 4.3 in a few days... so stay 
tuned... that promises to be fun (64 bits!).

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the Gdal-dev mailing list