Error creating application in cross-compiled qt in raspberries

I am trying to create a cross-compiled qt5 in raspberry pi. This application is based on this rf24l01 library . When I compile the cpp program from RPi, everything works fine, but when I tried to run my pc running ubuntu 12.04 (32bits) , the following error:

 error: cannot find -lrf24-bcm 

I point the library using this line in the pro file:

 LIBS += -L/mnt/rpi/usr/local/lib -lrf24-bcm 

AFAIK, this is the path where lib is located:

This is the result of `ls / mnt / rpi / usr / local / lib:

 librf24-bcm.so libwiringPiDev.so libwiringPi.so.2.0 librf24-bcm.so.1 libwiringPiDev.so.2.0 python2.6 librf24-bcm.so.1.0 libwiringPi.so python2.7 

Finally, this is a detailed error:

/home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl, -rpath-
link, / mnt / rpi / opt / vc / lib -Wl, -rpath-link, / mnt / rpi / usr / lib / arm-linux-gnueabihf -Wl, -rpath-
link, / mnt / rpi / lib / arm -linux-gnueabihf --sysroot = / mnt / rpi -Wl, -rpath, / usr / local / opt / lib -o homekit main.o -L / mnt / rpi / usr / local / lib -lrf24-bcm -L / mnt / rpi / usr / local / opt / lib -lQt5Network -L / usr / local / opt / lib -lQt5Core -lpthread
/home/atron/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm- linux-gnueabihf / bin / ld: can't find -lrf24-bcm
collect2: error: ld returned 1 exit status

What am I doing wrong?

Thanks in advance,

+2
source share
1 answer

I do not know if this is โ€œtechnicallyโ€ correct, but solved my problem. The main idea is to create a symbolic link to the library in the pc /usr/local/lib folder:

 sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so /usr/local/lib/librf24-bcm.so sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so.1 /usr/local/lib/librf24-bcm.so.1 sudo ln -s /mnt/rpi/usr/local/lib/librf24-bcm.so.1.0 /usr/local/lib/librf24-bcm.so.1.0 

Then in the QT creator *pro file you only need to add the link to lib:

 LIBS=-lrf24-bcm 

Hope this helps some newbies like me. Yours faithfully,

0
source

All Articles