[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: undefined reference error
From: |
Ralf Wildenhues |
Subject: |
Re: undefined reference error |
Date: |
Sat, 23 Oct 2010 10:04:27 +0200 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Hello Sergio,
* Sergio Belkin wrote on Wed, Oct 20, 2010 at 05:08:51PM CEST:
> I have a project that is a library that links against libresolv,
> It works fine on recent distros: Ubuntu 10.x Fedora 13, Mandriva
> 2010.1 but on Centos 5.x I get the following errors
>
> g++ -DHAVE_CONFIG_H -I. -I./include -I/usr/include/postgresql -O3
> -ansi -Wall -Wno-deprecated -D_FORTIFY_SOURCE=0 -MT testUpLog.o -MD
> -MP -MF .deps/testUpLog.Tpo -c -o testUpLog.o testUpLog.cc
> mv -f .deps/testUpLog.Tpo .deps/testUpLog.Po
> /bin/sh ./libtool --tag=CXX --mode=link g++ -O3 -ansi -Wall
> -Wno-deprecated -D_FORTIFY_SOURCE=0 -L/usr/lib64 -L/lib64
> -L/usr/lib64/mysql -o testUpLog testUpLog.o libUpTools.la -lpq
> -lmysqlclient -lssl -lpthread
> libtool: link: g++ -O3 -ansi -Wall -Wno-deprecated -D_FORTIFY_SOURCE=0
> -o .libs/testUpLog testUpLog.o -L/usr/lib64 -L/lib64
> -L/usr/lib64/mysql ./.libs/libUpTools.so -lpq -lmysqlclient -lssl
> -lpthread
> ./.libs/libUpTools.so: undefined reference to `__ns_name_uncompress'
> ./.libs/libUpTools.so: undefined reference to `__ns_initparse'
> ./.libs/libUpTools.so: undefined reference to `__ns_parserr'
> collect2: ld returned 1 exit status
> make[1]: *** [testUpLog] Error 1
Don't you need to link against libresolv? Try adding -lresolv to
testUpLog_LDADD.
Cheers,
Ralf