0

I've set up a cross compile toolchain for raspberry pi and I can compile basic helloworld and run it on raspberry.

I'm stuck at compiling some open-source programs as ./configure is complaining about missing packages, for example:

configure: No package 'glib-2.0' found

I'm using this. ./configure --host=arm-linux-gnueabihf to cross compile and it looks good until that error above.

Should I tell ./configure to use libs from target system? How to do it?

0

In most setups, everything in your toolchain in configured to use paths relative to your toolchain's compiler. In this case, if you copy for example arm-bcm2708-linux-gnueabi directory to /home/user/, it will use the directories inside /home/user/arm-bcm2708-linux-gnueabi to find appropriate files. For example, it will look for libraries in /home/user/arm-bcm2708-linux-gnueabi/lib.

Now if you check, you will find that you actually don't have any libraries in this directory. This is because it's only toolchain that you installed. You need proper libraries in order to compile some complicated software. You should compile needed libraries before you compile the application that you need. If the library that you want to compile uses autotools, this in most cases should should be fairly easy, just add --host=arm-bcm2708-linux-gnueabi --prefix=/home/user/arm-bcm2708-linux-gnueabi to your ./configure command.

Since it's not always as easy and your application can have multiple dependencies and each of it's dependencies can have another one's, it will quickly become annoying to this by hand. This is why there are some applications that automates this. One of the simplest is buildroot. It's usage instructions are unfortunately out of scope of this answer but I'm sure you can find a lot of informations about how to use it.

  • Thanks for pointing me that. If it looks to directory where toolchain is, could I mount Raspi filesystem to that point so it can use already installed libs? Or I'm missing something again? – 10robinho Apr 3 '13 at 10:24
  • @10robinho: Directly mounting Raspi filesystem on top of that directory is not good idea. You will override it contents this way. Also, you will have some issues with paths since some files in the filesystem are configured for other paths than you have in your toolchain. – Krzysztof Adamski Apr 3 '13 at 10:47
  • So, there is no way in which I could use raspi filesystem that has already installed needed libs? – 10robinho Apr 3 '13 at 11:02
  • It's not impossible but there is no easy way that I know. – Krzysztof Adamski Apr 3 '13 at 11:25
  • Another one you can try is biicode, it configures the cross-compiler, compiles the app and sends it to the rpi via rsync – hithwen Jan 31 '14 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.