After some research, I found the only way to create a plugin in C++ is to compile the QGIS source with the plugin created using the "plugin_builder.py" which can be found in the "src/plugins" on the git qgis (https://github.com/qgis/Quantum-GIS/tree/master/src/plugins)

To create a simple plugin which can be add simply by putting the folder of the plugin in ".qgis/python/plugins" or "C:/OSGeo4W/apps/qgis/python/plugins" the plugin must be written in Python.

Is there a way to create a plugin in C++ without compiling all the QGIS source ?

1 Answer 1


You shouldn't need to build QGIS just to make a C++ plugin. The only thing you should need to do is include the QGIS headers inside C:\OSGeo4W\apps\qgis-dev\include

The complied plugins then have to go into C:\OSGeo4W\apps\qgis-dev\plugins. This is the correct place for non python based plugins.

Note: I don't build C++ plugins, only Python ones.

  • thank you for your answer but I tried your method and the plugin doesn 't appear in the plugin manager
    – Lloyd
    Commented Jul 8, 2013 at 14:22
  • This can be due to a huge variety of reasons. To get a hint, you could have a look at the debug output using debug view and check if there is any output related to your plugin. Commented Jul 10, 2013 at 13:18
  • Yeah I think too this can be due to a variety of reason. To make the plugin I use this CMakeLists. Do you think it's a good start ? filedropper.com/cmakelists
    – Lloyd
    Commented Jul 11, 2013 at 11:35
  • Finaly the plugin was visible in Qgis but it's strange when I change a little bit the code and even if it's compile well, sometimes it's dissapear. Qgis checks if the plugin runs well when it starts ?
    – Lloyd
    Commented Jul 12, 2013 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.