1

I am making a Qt project based on QGroundControl which uses mavlink library. I googled it but not able to find the correct way. It can not be added as other libraries as it is a header only library. Please someone tell me the correct way to do it.

NG_
  • 6,895
  • 7
  • 45
  • 67
panand
  • 11
  • 2

1 Answers1

0

Well, first of all, this is not just a header-only library, so you will need to link against it either through direct LIBS usage or pkg-config if you get such a thing. In the former case, you may also need to adjust the INCLUDEPATH variable.

Then, in the source code you just do the regular include:

 #include <mavlink.h>

But that is probably not what you want, I think. You want to deal with QGroundControl in your project as that is your direct dependency. They do not seem to ship a .prf file though, so CONFIG+=x will not work.

However, if you install it properly, you may not even need to adjust the LIBS and INCLUDEPATH variables. In worst case, you have to. I think that is pretty much about it. You could also use pkg-config to deal with it as they seem to ship a .pc file.

László Papp
  • 51,870
  • 39
  • 111
  • 135
  • corrected myself. I just have to give the header file path in includepath in .pro file btw thanks for answering – panand Jun 09 '14 at 06:43