1

I am trying to cross compile the C++ movehead example from SDK, my machine is a VM UBUNTU 18.04.6 LTS. I created the ctc toolchain and configured it in qibuild. The cmake path is defined in cmakelists and when I try to build the program, the following error appears:

* (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

This is the CMakelists file

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)

The movehead.cpp file and others needed for qibuild are at: /home/name/Documents/naoqi-sdk-2.8.5.10-linux64/

The cross toolchain used is ctc-linux64-atom-2.8.5.10.

I need to compile the C++ code using naoqi-OS libraries for a NAO V6 robot.

1 Answers1

0

I don't know if it is the same error I had because I work with NAO v5 but adding the line:

set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0")

In the CMakeTextList.txt worked for me.

I found the answer here: BuildFailed Error: Cannot build C++ SDK Helloworld with qibuild

Tyler2P
  • 2,324
  • 26
  • 22
  • 31