cmake 用于NAO-Robot的C++交叉编译

5kgi1eie  于 2023-05-07  发布在  其他
关注(0)|答案(1)|浏览(205)

我试图从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)

movehead.cpp文件和qibuild所需的其他文件位于:/home/name/Documents/naoqi-sdk-2.8.5.10-linux64/
使用的交叉工具链是ctc-linux 64-atom-2.8.5.10。
我需要使用naoqi-OS库为NAO V6机器人编译C++代码。

eh57zj3b

eh57zj3b1#

我不知道这是不是和我遇到的错误一样,因为我使用的是NAO v5,但添加了以下行:

set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0")

CMakeTextList.txt为我工作。
我在这里找到了答案:BuildFailed Error: Cannot build C++ SDK Helloworld with qibuild

相关问题