This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Trouble compiling with gcc


"Meng-Hsueh Chiang" <mhchiang@mail.com> writes:

> I am having trouble to compile with gcc on Sun Sparc OS5.8. The error message is:
> 
> gcc -o help help.o
> ./../../src/lib/hlp.a   ./../../src/lib/misc.a -L/usr/X/lib -lXaw -lXt -lXext -Bstatic -lXmu  -Bdynamic -lX11 -lm -ltermlib  -lsocket -lnsl
> Undefined                       first referenced
>  symbol                             in file
> _dlopen                             /usr/lib/libc.a(nss_deffinder.o)
> _dlclose                            /usr/lib/libc.a(nss_deffinder.o)
> _dlsym                              /usr/lib/libc.a(nss_deffinder.o)

Find out what libraries these symbols are defined in, using grep and
    nm, and add those libraries to your command line.

Probably you need '-ldl' on the end of your command line, which tells
    gcc to link in libdl .

> ld: fatal: Symbol referencing errors.  No output written to help
> collect2: ld returned 1 exit status
> *** Error code 1
> 
> PS. my gcc is 3.2.2 (2.8.1 also tried)
> Any clue to where the error might come from will be greatly appreciated. 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]