0
votes

I'm trying to install NaoQI C++ SDK on Linux 18.04.1 (VirtualBox). I followed this installation instruction: http://doc.aldebaran.com/2-1/dev/cpp/install_guide.html

My problem is in Part E. Step.3, when I'm trying to run "qibuild make"

I get this error while I'm trying to build the helloworld example:

CMakeFiles/testhelloworld.dir/testhelloworld.cpp.o: In function main': /home/nounou/Documents/SDKfolder/naoqi-sdk/doc/dev/cpp/examples/core/helloworld/testhelloworld.cpp:35: undefined reference to AL::ALBroker::createBroker(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, int, std::__cxx11::basic_string, std::allocator > const&, int, int, std::__cxx11::basic_string, std::allocator >, bool)' /home/nounou/Documents/SDKfolder/naoqi-sdk/doc/dev/cpp/examples/core/helloworld/testhelloworld.cpp:38: undefined reference to AL::ALProxy::ALProxy(boost::shared_ptr<AL::ALBroker>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, int)' CMakeFiles/testhelloworld.dir/testhelloworld.cpp.o: In function qi::log::LogStream::~LogStream()':

....

CMakeFiles/testhelloworld.dir/build.make:113: recipe for target 'sdk/bin/testhelloworld' failed make[2]: * [sdk/bin/testhelloworld] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/testhelloworld.dir/all' failed make[1]: * [CMakeFiles/testhelloworld.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

[ERROR]: BuildFailed Error occurred when building project hello world

Please, help me if you have any idea about what the problem is. Thank you!

2
ALProxy is missing from your system, so the compiler cannot link. Either it's installed but not in a path that the compiler can find, or it's not installed. Check to see if "alcommon" library is installed.Owl
I checked it out. The "alcommon" library is installed. How I can do that the compiler can find it?noudels
Which version of the C++ SDK have you installed ? 2.1 ?Emile
Listing the output of qitoolchain info could help figure out what is going on exactly.Emile
I have installed the version 2.1.4.13 of the C++ SDK. I have a NAO robot V4.noudels

2 Answers

0
votes

Most probably you have an ABI incompatibility issue, due to the transition to C++11. You are using Ubuntu 18.04, which compilers are configured to link with modern C++ libraries, but the toolchain is compiled with former ABIs, and does not enforce compiler flags to ensure compatibility.

To workaround this, either:

  • Set compiler flags to make sure you don't link against C++11 libraries (if someone knows them, please share).
  • Compile for the robot instead of your machine, by using the cross-toolchain instead of the Linux toolchain.
  • Use Ubuntu 12.04, as told in the installation guide.

By the way, in the C++ installation guide, subsection E.4, it says to compile the example under core/sayhelloworld. Here you compiled the example under core/helloworld.

0
votes

I had the same problem with Fedora 29... After some hours of search I found that adding set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0") to the CMakeLists.txt file fixed the problem.

I found the solution here: gcc using c++11 standard even though 98 explicitly specified