I'm new to cross compiling (and the raspberry pi). I have managed to get basic applications compiling using raspberry pi tools (https://github.com/raspberrypi/tools). This is all compiling and working fine. Now I'm starting to use the CImg library which uses X11. I'm compiling that natively in linux on my PC using:
- Code: Select all
g++ -o native-cimg-test "cimg_test.cpp" -O2 -L/usr/X11R6/lib -lm -lpthread -lX11
Which works great. However when I try to compile it for pi using arm-bcm2708-linux-gnueabi-g++ with those same flags, I get the error:
- Code: Select all
/home/will/pi/tools/arm-bcm2708/arm-bcm2708-linux-gnueabi/bin/../lib/gcc/arm-bcm2708-linux-gnueabi/4.7.1/../../../../arm-bcm2708-linux-gnueabi/bin/ld: cannot find -lx11
collect2: error: ld returned 1 exit status
make: *** [cimg-pi] Error 1
I don't really know what all those flags do so trying to find the problem is proving difficult. I assume I need libx11.a/so for the raspberry pi? Any pointers would be great