<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<p>Hi, all:</p>
<p>I'm trying to cross compile a package with CMake. I strictly
followed the documentation here: <a
href="https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html">https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html</a></p>
<p>But, still obtained the following ERROR messages:</p>
<p><br>
</p>
<p><br>
</p>
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; font-size: 11.9px; margin-top: 0px; margin-bottom: 0px; overflow-wrap: normal; padding: 16px; overflow: auto; line-height: 1.45; background-color: rgb(246, 248, 250); border-radius: 3px; word-break: normal; color: rgb(36, 41, 46); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);">CMake Error at /usr/share/cmake-3.13/Modules/CMakeTestCCompiler.cmake:52 (message):</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> The C compiler</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> "....../RPi/bin/arm-rpi-linux-gnueabihf-gcc"</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> is not able to compile a simple test program.</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> It fails with the following output:</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> Change Dir: ....../flann/build/CMakeFiles/CMakeTmp</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> Run Build Command:"/usr/bin/make" "cmTC_78471/fast"</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> /usr/bin/make -f CMakeFiles/cmTC_78471.dir/build.make CMakeFiles/cmTC_78471.dir/build</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> make[1]: Entering directory '....../flann/build/CMakeFiles/CMakeTmp'</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> Building C object CMakeFiles/cmTC_78471.dir/testCCompiler.c.o</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> ....../RPi/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=....../rootfs -o</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> CMakeFiles/cmTC_78471.dir/testCCompiler.c.o -c ....../flann/build/CMakeFiles/CMakeTmp/testCCompiler.c</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> Linking C executable cmTC_78471</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_78471.dir/link.txt --verbose=1</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> ....../RPi/bin/arm-rpi-linux-gnueabihf-gcc --sysroot=....../rootfs -rdynamic</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> CMakeFiles/cmTC_78471.dir/testCCompiler.c.o -o cmTC_78471</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> ....../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</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> ....../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</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> collect2: error: ld returned 1 exit status</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> make[1]: *** [CMakeFiles/cmTC_78471.dir/build.make:87: cmTC_78471] Error 1</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> make[1]: Leaving directory '....../flann/build/CMakeFiles/CMakeTmp'</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> make: *** [Makefile:121: cmTC_78471/fast] Error 2</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> CMake will not be able to correctly generate this project.</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> Call Stack (most recent call first):</span>
<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 92, 197);"> CMakeLists.txt:24 (project)
</span></pre>
<p><br>
</p>
<p>To be more specific, I'm trying to cross compile flann (<a
href="https://github.com/mariusmuja/flann">https://github.com/mariusmuja/flann</a>)
for raspberry pi 3B (<a
href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">https://www.raspberrypi.org/products/raspberry-pi-3-model-b/</a>)
.</p>
<p><br>
</p>
<p>Can anybody please give me a hand?</p>
<p><br>
</p>
<p>Cheers<br>
</p>
<p><br>
</p>
<div class="moz-signature">-- <br>
Dr. Pei Jia
CEO of Longer Vision Technology (Canada) Ltd. <br>
Website: <a href="https://www.longervision.ca">https://www.longervision.ca</a>
<br>
Email: <a href="mailto:jiapei@longervision.com">jiapei@longervision.com</a>
<br>
cell phone in Canada: <a href="tel:+17788635816">778-863-5816</a>
</div>
</body>
</html>