Issues getting started with examples

I have followed the guide for installing DroneCodeSDK and got it on my RaspberryPi running Raspbian just fine.

So far I have been able to run cmake on the examples and I did so as well on the DronecodeSDK root folder.
Unfortunately, when I attempt to make the examples I get errors about the #include statements stating that the directory does not exist for each of the .h files.
I tried to run cmake on the plugins folder, but I receive the following error: “install TARGETS given no LIBRARY DESTINATION”

To be quite honest, I am not sure if running cmake on the plugins will fix my issue with running any of the examples (specifically takeoff_land), but since I was having issues with their header files being found I figured it is probably the next step I should try.

Any help would be appreciated. Sorry if I am just missing something obvious.

Ok, so for the examples to build and run the library needs to be installed. Installing a library means that the header (.h) files can be found and included, as well as the library files (.so) found and linked to.

I suggest you have a look at these docs:
https://sdk.dronecode.org/en/guide/toolchain.html
https://sdk.dronecode.org/en/examples/

The easiest on Linux to install and use the library in an example should be:

make default
sudo make default install

This will install the library into /usr/local/lib/libdronecode_sdk_*/ and /usr/local/include/dronecode_sdk/*.
Cmake should be able to find your include and library files. If you get undefined reference to ... on execution, you need to specify the additional linking directory:

export LD_LIBRARY_PATH=/usr/local/lib

And then you can try to run it again.

If you want to install it into /usr/include and /usr/lib which is where your distribution’s packages usually go (e.g. using apt-get, you can do that by specifying this prefix manually:

make clean
make INSTALL_PREFIX=/usr
sudo make default install

Still no luck sadly.

Steps I took:

I went to the DronecodeSDK folder.
I ran “make default”
I ran “sudo make default install” (these both worked fine)
I went into the takeoff_land example folder and tried to run “make”
I received the same error so I tried the export, make clean, install_prefix, and install lines you mentioned.
Went back to the takeoff_land example folder and tried again.

Still getting the error “fatal error: dronecode_sdk/plugins/action/action_impl.h: No such file or directory”
This error is in reference to the CMakeList.txt line “#include donecode_sdk/plugins/action/action_impl.h”

I will try to start fresh and see if I can get it running, but so far I havent been able to get it going.

Thanks again for the assistance, btw. And for the documentation links. I tried creating a new CMakeList.txt file using the instructions in the document provided, but still nothing.

After reinstalling I was able to get it to load up first try. All I did that the guide and you didnt mention was switch to master (from the default development branch).

Thanks so much again for all the help, and the links to the tutorial guides!

1 Like