Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Setting up a Qt Creator project including access to QGIS API
Forum Updated to NodeBB v4.3 + New Features

Setting up a Qt Creator project including access to QGIS API

Scheduled Pinned Locked Moved Qt Creator and other tools
15 Posts 7 Posters 16.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    franku
    wrote on last edited by
    #5

    bq. For my own information I grabbed me the qgis-1.8.0.tar.bz2 from the download setion [hub.qgis.org]. Inside you

    Have a look at this link. There you will find a tarfile (you probably found already), that you can unzip with 7zip. If you are running on windows we can have a try on building QGIS on windows. We will have a try. No more in the first step, so don't feel embarrassed. There are more than one windows developer undercover, as you might think ;-)

    bq. But I was able to download QGIS using the GITHub website. Then it tells how to build the QGIS project using CMAKE but I get dozens of errors. So there are no clear instructions on how to build the right libraries and DLLs in Windows.

    Did you install the msys environment or the QtSDK as well? The INSTALL file in the tar-archive contains some helpful comments you should read and try out. There is no automated click-compile-and-ready button, you have to spend some time to figure out how it works.

    This, Jen, is the internet.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      KyJavaGeek
      wrote on last edited by
      #6

      [quote author="franku" date="1342288048"]bq. For my own information I grabbed me the qgis-1.8.0.tar.bz2 from the download setion [hub.qgis.org]. Inside you

      No more in the first step, so don't feel embarrassed. There are more than one windows developer undercover, as you might think ;-)

      [/quote]

      I am not the least bit embarrassed. I do not feel inferior because I don't understand something. I am a solutions architect directed to develop an application on a Windows platform. I willing help others with areas in my expertise without assuming they are embarrassed when asking questions.

      [quote author="franku" date="1342288048"]
      bq. But I was able to download QGIS using the GITHub website. Then it tells how to build the QGIS project using CMAKE but I get dozens of errors. So there are no clear instructions on how to build the right libraries and DLLs in Windows.

      Did you install the msys environment or the QtSDK as well? The INSTALL file in the tar-archive contains some helpful comments you should read and try out. There is no automated click-compile-and-ready button, you have to spend some time to figure out how it works.
      [/quote]

      That is the reason I was asking questions. The entire reason for having Forums like this is to provide information so every single person trying to do this doesn't have to go through the same pain and agony.

      I have installed QGIS-final-1.8.0.2 Windows binary. I was also able to download the full GIT archive of QGIS v1.8.0.2 that includes the source. I have the full QtSDK installed. When I tried to follow a tutorial for developing a Qt Application that uses the QGIS libraries I couldn't determine where the appropriate libraries are and the tutorial did not identify them. So I started my search of those libraries with no success. Surely somewhere there is a set of QGIS binaries for Windows that include the appropriate libraries to use the API in a Qt project. Why force every single developer to generate those libraries from the source? You may consider it a fun exercise. I just need to make progress on this project or find a different set of tools.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        franku
        wrote on last edited by
        #7

        You are very welcome to ask questions. If you are looking for more definite answers on building/using QGis you may want to ask on some other mailing list: "QGis Mailing List":http://qgis.org/community/mailing-lists.html.

        bq. Why force every single developer to generate those libraries from the source?

        Sometimes this is the open source way to go. You installed some windows binaries package a team of developers has provided without any charge. If you want to use their binaries with a toolset, you have to figure out, what toolset they are for. Maybe you will get further with VisualStudio. But then you will have some issues with the opensource package of Qt.

        bq. From INSTALL-file: 4.2. Building using MinGW

        Note: This section might be outdated as nowadays Visual C++ is use to build the "official" packages.

        As said above, you may want to ask at the QGIS community on how to work with their code and libraries. To speak for myself, always feel free to come back and ask precise questions. You are very welcome.

        This, Jen, is the internet.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KyJavaGeek
          wrote on last edited by
          #8

          After a ton of searching and days trying to work with out of date "how to" guides I finally found a set of instructions that actually work. It was still a battle of trial and error but this guide was 95% correct. It came off the QGIS website, but it was still difficult to find. The URL is http://www.qgis.org/api/INSTALL.html#toc14. (Pretty obvious at this point but I Googled this issue for hours.) It gives a pretty fair explanation of how to build QGIS using Visual Studio 2008 Express. There are still some little tidbits of information left out. But you can find an explanation of what is wrong with it at "osgeo-org on nabble":http://osgeo-org.1560.n6.nabble.com/build-qgis-in-Windows-missing-GEOS-and-PROJ-4-td4952935.html. When you get to cmake-gui your first attempt at building the project will fail. It is then that you will discover what the errors are and the second link above gives the answers.

          I haven't tried using the new libraries in a Qt project yet but I am confident they will work. I had so much garbage on my machine after attempting to follow 4 or 5 different guides that were out of date and basically inaccurate. Before starting this install I removed everything including Qt and started again from scratch.

          I do appreciate the feedback and apologize for the frustrated comments.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            franku
            wrote on last edited by
            #9

            Hi KyJavaGee, well done. Your work appears to be good research work.

            However, please note, if you want to use Qt opensource the Qt-VisualStudio Plugin does not work with the express editions of VS. In addition, if you want to use the libs of QGIS you've now built with VS2008 then you have to make the right import libraries for MinGW gcc linker as well.

            Please aks others if there was a way to build Qt opensource with VS. I've never used it. Maybe someone in the forum knows.

            This, Jen, is the internet.

            1 Reply Last reply
            0
            • K Offline
              K Offline
              KyJavaGeek
              wrote on last edited by
              #10

              Thanks for your reply. I have successfully built QGis using VS Express. I'm not trying to use the plugin. I can't afford to pay the license fee for regular VS. I am trying to use Qt Creator for my project work. Now my challenge is configuring Qt Creator to find and use the QGis libraries.

              Since I am a Java developer and haven't developed in C++ for 15 years it is a real challenge just setting up the environment properly. Many of the posts that should help in this area do not state whether that solution is for Linux or Windows. So I've been busting my buns trying to find out how to generate ".a" files just to find out that is a Linux concept. When I built the Windows version of QGis it should have build .lib files that properly point to the DLLs. But evidently they don't.

              I don't know if I built the QGis improperly (or installed it wrong) or if I haven't got Qt Creator configured improperly. All I know is that Qt Creator finds no problems with syntax on my first Qt/QGis sample program. But it fails at run time not being able to find all the correct classes. So Qt Creator is obviously not finding all the proper DLLs.

              I'm going to go back and try to recreate the Qt project and make sure I didn't miss something. I think I am very, very close. I need be able to show my partners that this is a viable solution this week.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                franku
                wrote on last edited by
                #11

                If you don't want to buy the VS and mix work with QtCreator using the opensource version of Qt, this contains a distribution of MinGW. MinGW is a gnu compiler/linker toolchain that needs import libraries usually built with a .a fileextension. If you build the QGis with VS then the import libs will have a .lib extension. In my experience they cannot be used with MinGW, as already mentioned above. If you want to use the dlls anyway, then you can derive the import libs for the gnu toolchain with pexports and dlltool. There are some howtos in the web you can follow. However, this needs extra work to be done.

                This, Jen, is the internet.

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rionms
                  wrote on last edited by
                  #12

                  I have to develop an application with QtCreator and QGIS and it seems that I have faced the same problem for more than a week. And finally found this topic (thanks god!). Could you please tell us if you managed to develop your application with QtCreator (and if it is yes, tell us more about it) or if you used VS in the end?

                  P 1 Reply Last reply
                  0
                  • R rionms

                    I have to develop an application with QtCreator and QGIS and it seems that I have faced the same problem for more than a week. And finally found this topic (thanks god!). Could you please tell us if you managed to develop your application with QtCreator (and if it is yes, tell us more about it) or if you used VS in the end?

                    P Offline
                    P Offline
                    Puneet_Kumar
                    wrote on last edited by
                    #13

                    @rionms
                    Hereafter 7 years, I am trying the same things. I am trying to build a sample application in Qt with QGIS capabilities in windows.I installed OSGeo4W64 installer for QGIS. but I don't know how to use this in QT. I mean which libraries and header file I have to include in .pro file .

                    Christian EhrlicherC A 2 Replies Last reply
                    0
                    • P Puneet_Kumar

                      @rionms
                      Hereafter 7 years, I am trying the same things. I am trying to build a sample application in Qt with QGIS capabilities in windows.I installed OSGeo4W64 installer for QGIS. but I don't know how to use this in QT. I mean which libraries and header file I have to include in .pro file .

                      Christian EhrlicherC Online
                      Christian EhrlicherC Online
                      Christian Ehrlicher
                      Lifetime Qt Champion
                      wrote on last edited by Christian Ehrlicher
                      #14

                      @Puneet_Kumar Wouldn't it be better to ask the QGIS community then? They must know what libraries you need to develop something for QGIS - how should we?

                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                      Visit the Qt Academy at https://academy.qt.io/catalog

                      1 Reply Last reply
                      1
                      • P Puneet_Kumar

                        @rionms
                        Hereafter 7 years, I am trying the same things. I am trying to build a sample application in Qt with QGIS capabilities in windows.I installed OSGeo4W64 installer for QGIS. but I don't know how to use this in QT. I mean which libraries and header file I have to include in .pro file .

                        A Offline
                        A Offline
                        Aman55
                        wrote on last edited by
                        #15

                        @Puneet_Kumar Recently i had successfully setup qgis qt setup in ubuntu .
                        you might take a look https://github.com/aman2000jaiswal14/QGIS-CPP-API-QT5

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved