This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: trying to understand undefined reference for dladdr


On Tuesday 18 August 2009 18:56:12 Brendan Miller wrote:
> I have some code like:
>
> #include <dlfcn.h>
> ...
> // function call in some code later.
> dladdr(addr, &addrInfo);
>
> That is compiled into a static library libmy_library.a
>
> When I go to link the library into the program containing my main
> routine I get this:
> g++ -o program -rdynamic main.o  libmy_library.a
> libmy_library.a(my_library.o): In function `SomeFunction(void*)':
> /path/to/src/my_library.cpp:68: undefined reference to `dladdr'
> collect2: ld returned 1 exit status

did you try linking against libdl like the man page says to ?
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


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