Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling example with g++ directly instead of CMake #802

Closed
imfatant opened this issue Jul 17, 2019 · 4 comments
Closed

Compiling example with g++ directly instead of CMake #802

imfatant opened this issue Jul 17, 2019 · 4 comments
Labels

Comments

@imfatant
Copy link

imfatant commented Jul 17, 2019

I've built and installed the MAVLINK library as described in the documentation (Linux).

In takeoff_and_land.cpp, we have:

#include <mavsdk/mavsdk.h>
#include <mavsdk/plugins/action/action.h>
#include <mavsdk/plugins/telemetry/telemetry.h>

This directory structure seems completely different to the one extant.

@JonasVautherin
Copy link
Collaborator

I'm not sure I understand the question. takeoff_and_land.cpp seems fine to me. Did you install using a package (e.g. *.deb) from the releases?

@imfatant
Copy link
Author

I'm using vscode and would rather compile without using cmake. Now, I've got it working with cmake by setting up two build tasks in vscode, which means that the install went fine, but when using g++ directly, I get:

> Executing task: g++ -Wno-unused-parameter -Wno-unused-variable -Wall -Weffc++ -Wextra -Wsign-conversion -g takeoff_and_land.cpp -o takeoff_and_land -I/usr/local/include -L/usr/local/lib -lmavsdk -lmavsdk_action -lmavsdk_telemetry <

In file included from takeoff_and_land.cpp:8:0:
/usr/local/include/mavsdk/plugins/action/action.h:6:10: fatal error: plugin_base.h: No such file or directory
 #include "plugin_base.h"
          ^~~~~~~~~~~~~~~
compilation terminated.
The terminal process terminated with exit code: 1

Would be most grateful for any ideas.

@JonasVautherin
Copy link
Collaborator

What about adding something like -I/usr/local/include/mavsdk? Seems to me like MAVSDKTargets.cmake does something like that.

@imfatant
Copy link
Author

That works!

Thank you:)

@JonasVautherin JonasVautherin changed the title Has the directory structure changed? Compiling example with g++ directly instead of CMake Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants