error in compiling with cross compiler

3 posts
by wael » Sun Mar 24, 2013 6:53 am
i've started to use the cross compiler with eclipse in order to make an image processing program using Opencv.
well, when i I build my programm i obtain this text error:

**** Build of configuration Debug for project RPI ****

make all
Building file: ../main.cpp
Invoking: Cross G++ Compiler
/home/wael/raspbian_toolchain/bin/arm-linux-gnueabihf-g++ -I/home/wael/raspbian_toolchain/arm-linux-gnueabihf/include -I/home/wael/raspbian_toolchain/arm-linux-gnueabihf/libc/usr/include -I/home/wael/raspbian_toolchain/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed -I/home/wael/raspbian_toolchain/lib/gcc/arm-linux-gnueabihf/4.7.2/include -I/home/wael/raspbian_toolchain/lib/gcc/arm-linux-gnueabihf/4.7.2/finclude -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: RPI
Invoking: Cross G++ Linker
/home/wael/raspbian_toolchain/bin/arm-linux-gnueabihf-g++ -L/usr/local/lib -L/home/wael/raspbian_toolchain/arm-linux-gnueabihf/lib -L/home/wael/raspbian_toolchain/arm-linux-gnueabihf/libc/lib -L/home/wael/raspbian_toolchain/arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf -L/home/wael/raspbian_toolchain/lib/gcc/arm-linux-gnueabihf/4.7.2 -L/home/wael/raspbian_toolchain/libexec/gcc/arm-linux-gnueabihf/4.7.2 -o "RPI" ./main.o
arm-linux-gnueabihf-g++: erreur fatale: -fuse-linker-plugin, but not found
compilation terminée.
make: *** [RPI] Erreur 1

**** Build Finished ****
Posts: 1
Joined: Sun Mar 24, 2013 6:48 am
by jamesh » Sun Mar 24, 2013 8:45 am
It's not finding a library. You will need to find the source for the missing library and also compile that as well, or perhaps if already available on a Raspi you could grab it from there. If its a library you would expect to already have, then perhaps you need to set up your library path to include the directory is in.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 16443
Joined: Sat Jul 30, 2011 7:41 pm
by IanH2 » Tue Mar 26, 2013 9:33 am
The '' library is a file which should come with your gcc (if it needs it). 'lto' is link-time optimisation, which does various things (not all of them useful) with the code when it has the whole program available to look at, and the .so file is code which gcc uses when doing this.

So I'd suggest the problem is that the gcc hasn't been built, or installed, properly. (On the x86 Debian system I'm on at the minute, I've got a next to 'cc1', 'cc1plus', 'collect2' etc). Probably the best answer is to use a different gcc (did you want French error messages?).

Otherwise, a workaround may be to add '-fno-use-linker-plugin' to the compiler options, if you can stand the tedium of persuading Eclipse to do this.
Posts: 79
Joined: Tue Dec 18, 2012 10:17 am