我在这里迷路了。我有一个交叉编译器工具链,我正在尝试将其与cmake和柯南结合使用来构建googletest(1.8.1)。但是,在编译期间,ld抱怨在给定路径中缺少一些libc.so.6
,libc_nonshared.a
和ld-linux-aarch64.so.1
之类的库文件。但是事实是它确实存在在它要查找的路径中。因此,我不确定这是否是由于CMAKE,柯南或gcc引起的。任何帮助都非常感谢。
这是CMakeError.log
上的日志
Determining if the C compiler works failed with the following output:
Change Dir: /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp
Run Build Command:"/usr/local/bin/gmake" "cmTC_c9ef1/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTC_c9ef1.dir/build.make CMakeFiles/cmTC_c9ef1.dir/build
gmake[1]: Entering directory '/Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc --sysroot=/Users/Sujit/work/clarifai-iot-sdk-dev/conan/profiles/../../../iotvol2/aarch64-rpi3b+-linux-gnueabihf -fPIC -o CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o -c /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_c9ef1
/usr/local/Cellar/cmake/3.11.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c9ef1.dir/link.txt --verbose=1
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc --sysroot=/Users/Sujit/work/clarifai-iot-sdk-dev/conan/profiles/../../../iotvol2/aarch64-rpi3b+-linux-gnueabihf -fPIC -rdynamic CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o -o cmTC_c9ef1
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/libc.so.6 inside /Users/Sujit/work/clarifai-iot-sdk-dev/conan/profiles/../../../iotvol2/aarch64-rpi3b+-linux-gnueabihf
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/libc_nonshared.a inside /Users/Sujit/work/clarifai-iot-sdk-dev/conan/profiles/../../../iotvol2/aarch64-rpi3b+-linux-gnueabihf
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/ld-linux-aarch64.so.1 inside /Users/Sujit/work/clarifai-iot-sdk-dev/conan/profiles/../../../iotvol2/aarch64-rpi3b+-linux-gnueabihf
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_c9ef1.dir/build.make:87: cmTC_c9ef1] Error 1
gmake[1]: Leaving directory '/Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_c9ef1/fast] Error 2
我在终端中收到的错误消息是:
gtest/1.8.1@bincrafters/stable: WARN: Build folder is dirty, removing it: /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd
gtest/1.8.1@bincrafters/stable: Building your package in /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd
gtest/1.8.1@bincrafters/stable: Copying sources to build folder
gtest/1.8.1@bincrafters/stable: Generator cmake created conanbuildinfo.cmake
gtest/1.8.1@bincrafters/stable: Calling build()
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc
-- Check for working C compiler: /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc -- broken
CMake Error at /usr/local/Cellar/cmake/3.11.0/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp
Run Build Command:"/usr/local/bin/gmake" "cmTC_c9ef1/fast"
/usr/local/bin/gmake -f CMakeFiles/cmTC_c9ef1.dir/build.make CMakeFiles/cmTC_c9ef1.dir/build
gmake[1]: Entering directory '/Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc --sysroot=/Users/Sujit/project/conan/profiles/../../../cross/aarch64-rpi3b+-linux-gnueabihf -fPIC -o CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o -c /Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_c9ef1
/usr/local/Cellar/cmake/3.11.0/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c9ef1.dir/link.txt --verbose=1
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/bin/aarch64-rpi3b+-linux-gnueabihf-gcc --sysroot=/Users/Sujit/project/conan/profiles/../../../cross/aarch64-rpi3b+-linux-gnueabihf -fPIC -rdynamic CMakeFiles/cmTC_c9ef1.dir/testCCompiler.c.o -o cmTC_c9ef1
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/libc.so.6 inside /Users/Sujit/project/conan/profiles/../../../cross/aarch64-rpi3b+-linux-gnueabihf
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/libc_nonshared.a inside /Users/Sujit/project/conan/profiles/../../../cross/aarch64-rpi3b+-linux-gnueabihf
/Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/lib/gcc/aarch64-rpi3b+-linux-gnueabihf/8.1.0/../../../../aarch64-rpi3b+-linux-gnueabihf/bin/ld: cannot find /Users/Sujit/cross/aarch64-rpi3b+-linux-gnueabihf/aarch64-rpi3b+-linux-gnueabihf/lib/ld-linux-aarch64.so.1 inside /Users/Sujit/project/conan/profiles/../../../cross/aarch64-rpi3b+-linux-gnueabihf
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_c9ef1.dir/build.make:87: cmTC_c9ef1] Error 1
gmake[1]: Leaving directory '/Users/Sujit/.conan/data/gtest/1.8.1/bincrafters/stable/build/402abb32ffec2d8dd422171fcdf2940f7af95bbd/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:126: cmTC_c9ef1/fast] Error 2
奇怪的是,我试图提供交叉编译器的多个版本(大约3种不同),以及尝试将本地编译器与gcc一起使用会导致相同的错误消息。清理所有内容并进行重建无济于事。所以,我在这里几乎迷路了。
我正在使用cmake 3.11.0在Mac OSX(10.14)上构建此文件,而CMakeLists.txt中所需的最小cmake为3.9
。
请问有指针吗?