Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am a 15 year veteran of Java making my first entry in to C++ applications. I have a specific need to develop a desktop application that produces graphics type output as well as displaying imbedded maps. It looks like Qt and QGIS API are exactly what I need to get this going.

I have been playing around with Qt Creator and generated several of the tutorials without too much problems. Now I am trying my first Qt project that incorporates the QGIS api. I am really stuck. I can't figure out where the libraries are that contains the QGIS modules. I think I have an idea how to configure the Qt project if I could find QGIS. I found all the .h files but some of what I need just aren't there.

There are some good examples of code that shows how to code with QGIS classes. But I can't find anything that explains how to set the project up. Could someone please help guide me through setting up a project in Qt Creator that will allow me to incorporate the QGIS modules? I have been searching everywhere. Google can be a strange beast. Sometimes you find what you need on the first search. Other times it just never happens.


share|improve this question

1 Answer 1

Check Tim's blog: Using QtCreator with QGIS and in QGIS' source you'll find src/plugins/plugin_builder.py

share|improve this answer
I tried Tim's blog. The instructions he provides are for Linux. They don't work for Windows. –  user1078284 Jul 15 '12 at 12:33
What doesn't work there? I'd except that the generated cmake stuff for a new plugin works just like the rest of the (core) plugins. Did you build QGIS with QtCreator on Windows? Because the usual C++ QGIS libraries don't work with MinGW and require MSVC 2008. –  jef Jul 16 '12 at 0:30
I have successfully built QGis on windows using VS 2010 Express. The generated QGis application itself works great. Now I am trying to integrate the QGis API in a Qt Creator project. I got the libraries in and get a good compile. But when I try to run the test ap it fails because it can't find any of the objects in the DLLs. It appears I need a "xxx.a" file to add to the project so it knows what DLLs to include. I don't have one in my QGis installation. How do I create this file? –  user1078284 Jul 19 '12 at 15:49
AFAIK MinGW and VS C++ ABI are incompatible. You can't use C++ stuff from VS with MinGW. So either use VS for your plugin or build QGIS with MinGW. –  jef Jul 19 '12 at 21:38
Either use MSVC 9/2008 with the stuff from osgeo4w (Qt, Python...; See qgis.org/api/INSTALL.html#toc14). That works even without building QGIS yourself.But anything else is mostly unknown territory, that you need to explore yourself. –  jef Sep 28 '12 at 7:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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