This is the mail archive of the gcc-bugs@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]

Re: dlopen, dlclose, problems


Quoting Edward_C_Morgan (ecmorgan@lucent.com):
> I'm on a solaris and I'm compiling a statically linked program and I'm
> getting the following errors when I'm linking it:
> $ g++ -static -O3 jnk.o -o jnk
> /usr/lib/libc.a(nss_deffinder.o): In function `SO_per_src_lookup':
> nss_deffinder.o(.text+0x74): undefined reference to `dlopen'
> nss_deffinder.o(.text+0xa4): undefined reference to `dlsym'
> nss_deffinder.o(.text+0xb8): undefined reference to `dlclose'
> /usr/lib/libc.a(nss_deffinder.o): In function `SO_per_src_delete':
> nss_deffinder.o(.text+0xf4): undefined reference to `dlclose'
> collect2: ld returned 1 exit status

Try adding '-ldl' to the link line:
$ g++ -static -O3 jnk.o -o jnk -ldl

Hope, that helps,
Martin.

-- 
Your mouse has moved. Windows must be restarted for the change
to take effect. Reboot now?


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