[gdal-dev] compile problems

Frank Warmerdam warmerdam at p...
Mon Apr 1 09:54:51 EST 2002


jsundu wrote:
> Hi all,
> 
> I'm trying to compile gdal 1.1.6 on a Redhat 7.2 distro. I am
> compiling gdal in /usr/local/src. I am using glibc-2.2.5 and
> gcc-3.0.4. Upon initiation of "make" I receive the following after
> many other messages. Could someone please tell me what might be wrong?

Jay,

I haven't run into this problem before. I have successfully built
with gcc 3.0.x before, so it isn't clear if that is the problem. Is
it possible that one or more of the libraries you are linking against
was compiled against an incompatible glibc or something? In fact,
looking at it the problem seems that libnsl.so and libresolv.so do
not seem to be finding stuff they require in the glibc that you are
using.

When I run into problems like this, I usually ferret around using the
nm command (which dumps all the symbols in an object or library file)
to find what is calling the missing functions.

eg.
nm core/*.o | grep strndup

However, this doesn't work on stripped shared libraries like your
/usr/lib/libresolve.so and /usr/lib/libnsl.so are likelely to be.

Good luck,

> make[1]: Entering directory `/usr/local/src/gdal/ogr'
> c++ -c -Iogrsf_frmts -I. -I../port -Wall -fPIC -O2 
> -I/usr/local/include ogrinfo.cpp -o ogrinfo.o
> c++ ogrinfo.o ogrsf_frmts/ogrsf_frmts.a ogr.a ../port/cpl.a -lpng -lz
> -lm -ldl -L/usr/local/lib -lm -L/usr/local/pgsql/lib -lpq -o ogrinfo
> /lib/libresolv.so.2: undefined reference to `__res_nclose at GLIBC_2.2'
> /lib/libnsl.so.1: undefined reference to `svc_getreq_poll at GLIBC_2.2'
> /lib/libnsl.so.1: undefined reference to `__strndup at GLIBC_2.2'
> /lib/libnsl.so.1: undefined reference to
> `__rpc_thread_svc_pollfd at GLIBC_2.2.3'
> /lib/libnsl.so.1: undefined reference to
> `__rpc_thread_svc_max_pollfd at GLIBC_2.2.3'
> /lib/libresolv.so.2: undefined reference to `__res_init at GLIBC_2.2'
> /lib/libresolv.so.2: undefined reference to `__res_ninit at GLIBC_2.2'
> /lib/libresolv.so.2: undefined reference to `__res_state at GLIBC_2.2'
> collect2: ld returned 1 exit status
> make[1]: *** [ogrinfo] Error 1
> make[1]: Leaving directory `/usr/local/src/gdal/ogr'
> make: *** [ogr-apps] Error 2



-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
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