Mavsdk: Build a Raspberry companion for PX4 to use MAVSDK

Created on 4 Feb 2021  路  6Comments  路  Source: mavlink/MAVSDK

Hi,
Why I still have this problem on Rasbian OS on Raspbery Pi 3?

pi@raspberrypi:/MAVSDK $ sudo cmake --build build/default
Scanning dependencies of target gtest
[ 1%] Building CXX object src/third_party/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 1%] Linking CXX shared library ../../../../lib/libgtestd.so
[ 1%] Built target gtest
Scanning dependencies of target mavsdk
[ 2%] Building CXX object src/core/CMakeFiles/mavsdk.dir/call_every_handler.cpp.o
[ 2%] Building CXX object src/core/CMakeFiles/mavsdk.dir/connection.cpp.o
In file included from /MAVSDK/src/core/mavsdk_impl.h:13:0,
from /MAVSDK/src/core/connection.cpp:2:
/MAVSDK/src/core/safe_queue.h:5:20: fatal error: optional: No such file or directory
compilation terminated.
make[2]: * [src/core/CMakeFiles/mavsdk.dir/build.make:76: src/core/CMakeFiles/mavsdk.dir/connection.cpp.o] Error 1
make[1]:
[CMakeFiles/Makefile2:182: src/core/CMakeFiles/mavsdk.dir/all] Error 2
make: *
* [Makefile:130: all] Error 2

//
is there I should clone the correct release for Raspberry Pi?

question

Most helpful comment

e> Nice, so the issue can be closed?

Thanks,
Everything goes well :)
Wish happy weekend for you guys.

All 6 comments

First, cmake does not need sudo. So this is most likely wrong: sudo cmake --build build/default.

Can you show the command line you use for the configure step? Is that a clean build?

fatal error: optional: No such file or directory

It looks like your compiler and standard library are too old and don't support features (like std::optional) used in MAVSDK.
What RPi OS image are you using? You probably have to update to something newer.

First, cmake does not need sudo. So this is most likely wrong: sudo cmake --build build/default.
yes. after got some error several times, I just thought to try with 'sudo' if there was any permission problem.

Can you show the command line you use for the configure step? Is that a clean build?
I did follow steps listed on build guide from MADSDK github

sudo apt-get update -y
sudo apt-get install cmake build-essential colordiff git doxygen -y

Clone the MAVSDK repository (or your fork):
git clone https://github.com/mavlink/MAVSDK.git
cd MAVSDK
git checkout develop
git submodule update --init --recursive

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -Bbuild/default -H.
cmake --build build/default
->>> at this phase I've got some errors

and, as julianoes has mentioned bellow, I forgot I installed old gcc to test very old module :(
so, now I did upgrade gcc to 8.3 and doing build again.

fatal error: optional: No such file or directory

It looks like your compiler and standard library are too old and don't support features (like std::optional) used in MAVSDK.
What RPi OS image are you using? You probably have to update to something newer.

Thanks!!! and, I forgot I installed old gcc to test very old module :(
so, now I did upgrade gcc to 8.3 and doing build again.
for some case, I am making another sd-card to install Raspbian burst 10 and gcc 9.1.

Nice, so the issue can be closed?

e> Nice, so the issue can be closed?

Thanks,
Everything goes well :)
Wish happy weekend for you guys.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uccsoft picture uccsoft  路  7Comments

julianoes picture julianoes  路  3Comments

hamishwillee picture hamishwillee  路  6Comments

shakthi-prashanth-m picture shakthi-prashanth-m  路  7Comments

hamishwillee picture hamishwillee  路  5Comments