"fatal error: plugin_base.h" when compiling the MAVSDK c++ examples

Hi. I have been trying to setup the MAVSDK examples following the instructions here: QuickStart · MAVSDK Guide
When I do

cmake --build build -j4

I get the following error:

In file included from /home/aerial/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8:
/usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory
   16 | #include "plugin_base.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/takeoff_and_land.dir/build.make:63: CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/takeoff_and_land.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

I have seen some discussions here regarding this error, however the proposed solutions did not work for me.
Has anyone encountered this error?


We have encountered same error. Did you solve it? If you solve it, please help me?

Yes, I recommend not following the quick guide because it leads to that error.
Instead follow this: Building library from Source · MAVSDK Guide


We tried however we have still same error. When we write “cmake --build build/default -j8” command line, we have encountered error. Do you have any idea to solve this error?

Try and do the ‘system-wide install’:

System-wide Install

By default (when CMAKE_INSTALL_PREFIX is not set, cmake tries to install system-wide. For Linux/macOS that’s /usr/local, for Windows it is somewhere in C:\Program Files.

To install system-wide the command needs to be run with sudo on Linux/macOS:

sudo cmake --build build/default --target install

I update cmake version to lastest and it works


have you been able to solve the Problem? I encounter the same issue.