alberich2k5
Posts: 11
Joined: Wed Jun 27, 2012 9:42 am

undefined reference to `dlopen'

Mon Jul 09, 2012 4:23 pm

Hello again!!

I'm using the cross-compiler in the raspberry pi repository at github.

When trying to cross-compile directfb, I'm getting this error:

libtool: link: warning: library `/home/projects/rpi/tools/arm-bcm2708/x86-linux64-cross-arm-linux-hardfp/bin/../arm-bcm2708hardfp-linux-gnueabi//sys-root/lib/libstdc++.la' was moved.
/home/projects/rpi/compile_test/dfb/DirectFB-1.6.1/lib/direct/.libs/libdirect.a(modules.o): In function `open_module':
/home/projects/rpi/compile_test/dfb/DirectFB-1.6.1/lib/direct/modules.c:448: undefined reference to `dlopen'

Any idea?
thanks!!

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: undefined reference to `dlopen'

Mon Jul 09, 2012 4:29 pm

Most likely a problem related to the move to multiarch in Debian wheezy (assuming you are targeting raspbian). You'll need /usr/lib/arm-linux-gnueabihf and /lib/arm-linux-gnueabihf on your library path. Also ensure the libdl.so symlinks aren't broken (may need converting to a relative rather than absolute symlink).

alberich2k5
Posts: 11
Joined: Wed Jun 27, 2012 9:42 am

Re: undefined reference to `dlopen'

Mon Jul 09, 2012 4:41 pm

I'm not targeting raspbian.

I'm using the target_fs and cross-compiler tools at the github, my intention is to build a tiny firmware from using this base. Just for learning.

I checked the arm-bcm2708hardfp-linux-gnueabi-gcc -v, and I could not find the path you mentioned. I though it should be there. Anyway I tried what you suggested and it did not work.

dannym
Posts: 7
Joined: Thu Jul 19, 2012 9:01 pm

Re: undefined reference to `dlopen'

Fri Jul 20, 2012 7:10 pm

Try adding -ldl to the end of the gcc command line just before the error in order to find out whether libdl actually works (and the reason of the problem is something else) or not.
You can also use strace to find out what files gcc is opening by prepending "strace" in front.

Return to “C/C++”