nao-robot 的 C++ 交叉编译

问题描述 投票:0回答:0

我正在尝试从 SDK 交叉编译 C++ movehead 示例,我的机器是 VM UBUNTU 18.04.6 LTS。 我创建了 ctc 工具链并在 qibuild 中配置了它。 cmake 路径在 cmakelists 中定义,当我尝试构建程序时,出现以下错误:

* (1/1) Building movehead in Debug
Scanning dependencies of target movehead
[ 50%] Linking CXX executable sdk/bin/movehead
../lib/libalproxies.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/movehead.dir/build.make:131: recipe for target 'sdk/bin/movehead' failed
make[2]: *** [sdk/bin/movehead] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/movehead.dir/all' failed
make[1]: *** [CMakeFiles/movehead.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

这是 CMakelists 文件

CMakeLists.txt

# Copyright (c) 2011 Aldebaran Robotics. All Rights Reserved.
cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)

# Give a name to the project.
project(movehead)

# Set _SDK_ROOT_DIR to the dirname of this file (/path/to/sdk)
get_filename_component(_SDK_ROOT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)

# Libraries are looked for in /path/to/sdk/lib,
# headers in /path/to/sdk/include, and so on.
set(qibuild_DIR "${_SDK_ROOT_DIR}/share/cmake/qibuild" INTERNAL CACHE "" FORCE)
set(CMAKE_PREFIX_PATH "${_SDK_ROOT_DIR}/share/cmake/" INTERNAL CACHE "" FORCE)

# This include enable you to use our CMake framework
find_package(qibuild)

# Create an executable named movehead,
# with the source file : movehead.cpp
qi_create_bin(movehead movehead.cpp)

# Tell CMake that movehead depends on ALCOMMON and ALPROXIES
# This will set the libraries to link movehead with,
# the include paths, and so on
qi_use_lib(movehead ALCOMMON ALPROXIES)

qibuild 所需的 movehead.cpp 文件和其他文件位于: /home/name/Documents/naoqi-sdk-2.8.5.10-linux64/

使用的交叉工具链是ctc-linux64-atom-2.8.5.10.

我需要使用 naoqi-OS 库为 NAO V6 机器人编译 C++ 代码。

cmake cross-compiling toolchain nao-robot cmakelists-options
© www.soinside.com 2019 - 2024. All rights reserved.