[CMake] Specify "NO multilib" for cross compilation ???

Pei Jia jiapei at longervision.com
Sun Sep 8 05:19:29 EDT 2019


Hi, all:

I'm trying to cross compile a package with CMake. I strictly followed 
the documentation here: 
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html

But, still obtained the following ERROR messages:



CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 
(message):
The C compiler

"....../RPi/bin/arm-rpi-linux-gnueabihf-gcc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: ....../flann/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_78471/fast"
/usr/bin/make -f CMakeFiles/cmTC_78471.dir/build.make 
CMakeFiles/cmTC_78471.dir/build
make[1]: Entering directory '....../flann/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_78471.dir/testCCompiler.c.o
....../RPi/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=....../rootfs -o
CMakeFiles/cmTC_78471.dir/testCCompiler.c.o -c 
....../flann/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_78471
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_78471.dir/link.txt 
--verbose=1
....../RPi/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=....../rootfs -rdynamic
CMakeFiles/cmTC_78471.dir/testCCompiler.c.o -o cmTC_78471
....../RPi/lib/gcc/arm-rpi-linux-gnueabihf/8.3.0/../../../../arm-rpi-linux-gnueabihf/bin/ld: 
cannot find crt1.o: No such file or directory
....../RPi/lib/gcc/arm-rpi-linux-gnueabihf/8.3.0/../../../../arm-rpi-linux-gnueabihf/bin/ld: 
cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_78471.dir/build.make:87: cmTC_78471] Error 1
make[1]: Leaving directory '....../flann/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_78471/fast] Error 2




CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:24 (project)


To be more specific, I'm trying to cross compile flann 
(https://github.com/mariusmuja/flann) for raspberry pi 3B 
(https://www.raspberrypi.org/products/raspberry-pi-3-model-b/) .


Can anybody please give me a hand?


Cheers


-- 
Dr. Pei Jia CEO of Longer Vision Technology (Canada) Ltd.
Website: https://www.longervision.ca
Email: jiapei at longervision.com <mailto:jiapei at longervision.com>
cell phone in Canada: 778-863-5816 <tel:+17788635816>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190908/1fc04ec0/attachment.html>


More information about the CMake mailing list