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.

tro
  • 6,152
  • 5
  • 42
  • 63
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.

lpapp
  • 47,035
  • 38
  • 95
  • 127
  • 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
  • @panand: http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – lpapp Jun 09 '14 at 08:00