[Bug 1002672] Re: apps can't be linked against libdl in 12.04
Jason Conti
1002672 at bugs.launchpad.net
Tue May 22 18:45:07 UTC 2012
You need to specify the libraries after the code that reference them. So
the correct method is:
gcc -o dltest dltest.o -ldl
The command line above would work anyways prior to oneiric, but from
oneiric onward the linker is more strict. See
http://wiki.debian.org/ToolChain/DSOLinking
Marking as invalid.
** Changed in: eglibc (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1002672
Title:
apps can't be linked against libdl in 12.04
Status in “eglibc” package in Ubuntu:
Invalid
Bug description:
An example program:
===
#include <stdio.h>
#include <dlfcn.h>
main()
{
dlopen("/lib/example.so", RTLD_NOW);
}
===
and its compilation gives:
===
lvd at ubuserv1204:~/tmp/dltest$ gcc -c dltest.c
lvd at ubuserv1204:~/tmp/dltest$ gcc -ldl -o dltest dltest.o
dltest.o: In function `main':
dltest.c:(.text+0xf): undefined reference to `dlopen'
collect2: ld returned 1 exit status
===
This bug exists in i386, pure amd64 and in multilib (both with -m32
option to gcc and without).
Please ask me for additional info.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1002672/+subscriptions
More information about the foundations-bugs
mailing list