总之,我试图用CMake交叉编译CMake,我认为我没有正确地链接库.我想做的可能是不可能的,但我至少想知道为什么不可能,如果是这样的话.
系统:主机是带有Cavium ARM9 CPU 的Linux机箱.它目前正在运行Linux内核版本2.6.24.4和Debian 5.0(Lenny).我的工作站是运行Ubuntu 12.04 LTS(精确穿山甲)的Core i5.
我的总体目标是在Linux机器上运行ROS.我必须从源代码编译而不是使用apt,因为Debian 6.0(Squeeze)二进制文件需要Cavium不提供的拇指支持,并且Debian 5.0(Lenny)不需要很多所需的软件包.我在安装所需的各种库方面取得了进展,但是当我进入步骤1.3.1并尝试运行CMake时,我收到了错误
需要CMake 2.8或更高版本.您正在运行2.6.0版
接下来我尝试在Linux机器上下载并构建CMake 2.8.8,但这对系统来说太过分了.当失败时,我下载了制造商网站上建议的工具链,并使用[www.cmake.org/Wiki/CMake_Cross_Compiling]上的交叉编译指南来构建CMake可执行文件.这是我的工具链文件:
# This one is important
SET(CMAKE_SYSTEM_NAME Linux)
# Specify the cross compiler
SET(CMAKE_C_COMPILER /pathto/crosstool-linux-gcc-4.5.2-gclibc-2.9-oabi/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER /pathto/crosstool-linux-gcc-4.5.2-gclibc-2.9-oabi/arm-unknown-linux-gnu/bin/arm-unknown-linux-gnu-g++)
# Where is the target environment
SET(CMAKE_FIND_ROOT_PATH /pathto/crosstool-linux-gcc-4.5.2-gclibc-2.9-oabi/arm-unknown-linux-gnu /pathto/crosstool-linux-gcc-4.5.2-gclibc-2.9-oabi/arm-unknown-linux-gnu/arm-unknown-linux-gnu)
# Search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# For libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Run Code Online (Sandbox Code Playgroud)
但是,在Linux机器上使用二进制文件会产生错误
cmake:/usr/lib/libstdc++.so.6:找不到版本`GLIBCXX_3.4.14'(cmake要求)
果然,图书馆不在那里:
prompt# strings /usr/lib/libstdc++.so.6 | …Run Code Online (Sandbox Code Playgroud)