I´ve downloaded the C++ code for the qgis_hello_world plugin from GitHUB (https://github.com/thebigspoon/qgis_cpp_plugin_cookbook)

I compiled with Visual Studio 2012 express on a win7 machine (though I had to comment out the Q_OBJECT macro), but it is unclear to me where to put the dll afterwards. I´ve tried c:\OSGeo4W\apps\qgis\plugins and c:\OSGeo4W\apps\qgis\qtplugins but it doesn´t seem to be loaded, and I don´t get any error messages.

This page (http://qgis.org/da/site/getinvolved/development/cppplugindevelopment.html#qgis-cpp-plugin-development) leaves me with the impression that in order to create c++ plugin I have to compile the entire QGIS source from scratch - is that correct?

  • Figured out a lot since my original post, so I´m doing this update just in case someone else stumble upon the same issues as I did. – Kaare Oct 16 '15 at 11:38
  • About Q_OBJECT macro: calling \OSGeo4W\bin\moc.exe on the .h-file with -o as option creates the necessary Q-object .cpp file – Kaare Oct 16 '15 at 11:40
  • About getting the code to work in QGIS, it was necessary to comment out all the 'std::cout << .......' in the .cpp file. Once this was done, the plugin loaded just fine. Hope this will be helpful to others – Kaare Oct 16 '15 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.