Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGiS Windows Source Build
Forum Updated to NodeBB v4.3 + New Features

QGiS Windows Source Build

Scheduled Pinned Locked Moved Unsolved General and Desktop
42 Posts 7 Posters 5.0k 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.
  • X Offline
    X Offline
    xanthas
    wrote on last edited by xanthas
    #13

    @Pl45m4
    So what I have understood is that when I download all dependencies and build QGiS from source, I should either use Qt to compile and build libraries or else I should use visual studio to build and compile it, right?
    Further, to make the UI and backend codes I should use the same compiler from which I had made the QGiS library, Am I right?

    What I have understood is the same thing discussed here also, I guess.

    jsulmJ 1 Reply Last reply
    0
    • X xanthas

      @Pl45m4
      So what I have understood is that when I download all dependencies and build QGiS from source, I should either use Qt to compile and build libraries or else I should use visual studio to build and compile it, right?
      Further, to make the UI and backend codes I should use the same compiler from which I had made the QGiS library, Am I right?

      What I have understood is the same thing discussed here also, I guess.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #14

      @xanthas said in QGiS Windows Source Build:

      right?

      No.
      Qt and visual studio are two completely different things.
      Qt is a C++ framework, Visual Studio is a IDE.
      What @Pl45m4 wrote is: you should use MSVC as compiler + Qt built with MSVC.
      Or you find (or build by yourself) QGIS built with MinGW + Qt built with MinGW.
      Reason: you cannot mix different C++ compiler (like you do now: MSVC + MinGW).

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • A Offline
        A Offline
        abhishek999
        wrote on last edited by
        #15

        can you give me step by step procedure to integrate qgis project in qt to show map in qt C++
        i am also facing same issue @jsulm

        jsulmJ 1 Reply Last reply
        0
        • A abhishek999

          can you give me step by step procedure to integrate qgis project in qt to show map in qt C++
          i am also facing same issue @jsulm

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #16

          @abhishek999 said in QGiS Windows Source Build:

          can you give me step by step procedure

          In the first post in this thread there is a link to a step by step explanation, follow it...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            abhishek999
            wrote on last edited by
            #17

            i am facing prolemScreenshot (10).png

            here is my .pro file
            QT += core gui

            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

            CONFIG += c++17

            You can make your code fail to compile if it uses deprecated APIs.

            In order to do so, uncomment the following line.

            #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

            SOURCES +=
            main.cpp
            mainwindow.cpp

            HEADERS +=
            mainwindow.h

            FORMS +=
            mainwindow.ui

            Include QGIS headers and libraries manually

            INCLUDEPATH += C:\OSGeo4W\apps\qgis-qt6-dev\include

            LIBS += C:/OSGeo4W/apps/qgis-qt6-dev/lib/qgis_3d.lib
            C:/OSGeo4W/apps/qgis-qt6-dev/lib/qgis_analysis.lib
            C:/OSGeo4W/apps/qgis-qt6-dev/lib/qgis_app.lib
            C:/OSGeo4W/apps/qgis-qt6-dev/lib/qgis_native.lib
            C:/OSGeo4W/apps/qgis-qt6-dev/lib/qgis_server.lib

            INCLUDEPATH += C:/OSGeo4W64/include

            Default rules for deployment.

            qnx: target.path = /tmp/$${TARGET}/bin
            else: unix:!android: target.path = /opt/$${TARGET}/bin
            !isEmpty(target.path): INSTALLS += target

            1 Reply Last reply
            0
            • A Offline
              A Offline
              abhishek999
              wrote on last edited by abhishek999
              #18

              @jsulm @Christian-Ehrlicher
              can you please tell me what exact is the problem i have reinstall qt ,Qgis ,OSGeo4W multiples time but still same problem i am facing

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #19

                You still doing the same thing as in your first post - you use a Qt compiled for MinGW and try to link it against a QGis compiled against MSVC. This will not work out - no matter how often you install something...

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

                B 1 Reply Last reply
                0
                • A Offline
                  A Offline
                  abhishek999
                  wrote on last edited by
                  #20

                  can you give me the steps to fix this @Christian-Ehrlicher

                  jsulmJ X 2 Replies Last reply
                  0
                  • A abhishek999

                    can you give me the steps to fix this @Christian-Ehrlicher

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #21

                    @abhishek999 Again: you have to use Qt built with MSVC compiler. So, install Qr for MSVC and use it...

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • A abhishek999

                      can you give me the steps to fix this @Christian-Ehrlicher

                      X Offline
                      X Offline
                      xanthas
                      wrote on last edited by
                      #22

                      @abhishek999 Currently what I am doing is that rebuilding QGiS using MSVC
                      If I get anything relevant and the steps starts to works
                      I will share it here
                      Please do the same (sharing it here) if you get anything or procedure that has to be followed

                      1 Reply Last reply
                      0
                      • Christian EhrlicherC Christian Ehrlicher

                        You still doing the same thing as in your first post - you use a Qt compiled for MinGW and try to link it against a QGis compiled against MSVC. This will not work out - no matter how often you install something...

                        B Offline
                        B Offline
                        Bonnie
                        wrote on last edited by Bonnie
                        #23

                        @Christian-Ehrlicher Surprisingly who you just replied is not the OP :) but they are making, or were making the same mistake.

                        1 Reply Last reply
                        1
                        • A Offline
                          A Offline
                          abhishek999
                          wrote on last edited by
                          #24

                          here is the kit that i have selcted
                          Screenshot (11).png ![Screenshot (12).png]

                          and i am getting this error @jsulm @Christian-Ehrlicher

                          (https://ddgobkiprc33d.cloudfront.net/a0de40c2-7bda-4422-ab48-b948de7f128c.png)

                          jsulmJ JonBJ 2 Replies Last reply
                          0
                          • A abhishek999

                            here is the kit that i have selcted
                            Screenshot (11).png ![Screenshot (12).png]

                            and i am getting this error @jsulm @Christian-Ehrlicher

                            (https://ddgobkiprc33d.cloudfront.net/a0de40c2-7bda-4422-ab48-b948de7f128c.png)

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #25

                            @abhishek999 Please post errors as text, not pictures.
                            You should search for the first error or post the whole build log here as text.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • A abhishek999

                              here is the kit that i have selcted
                              Screenshot (11).png ![Screenshot (12).png]

                              and i am getting this error @jsulm @Christian-Ehrlicher

                              (https://ddgobkiprc33d.cloudfront.net/a0de40c2-7bda-4422-ab48-b948de7f128c.png)

                              JonBJ Offline
                              JonBJ Offline
                              JonB
                              wrote on last edited by JonB
                              #26

                              @abhishek999
                              You posted just this and I tried to answer in your annoying post at https://forum.qt.io/topic/159740/qt-creator-and-qgis-integration-problem/2. But you have ignored that. So in addition to calling everyone out by name there to answer your question you then don't respond to answers there and have another topic running with same question here, and people answer in one place and don't know you are making them also answer in another. Do you see how irritating this for people trying to respond to you?

                              1 Reply Last reply
                              1
                              • A Offline
                                A Offline
                                abhishek999
                                wrote on last edited by
                                #27

                                @JonB
                                Apologies for the confusion. I’ve deleted the previous post and will keep my questions in one place from now on.

                                I successfully included the library, but when I try to display the map in Qt, I encounter the following error (see screenshot). Any suggestions on how to resolve this issue?
                                Screenshot 2.jpeg

                                jsulmJ 1 Reply Last reply
                                0
                                • A abhishek999

                                  @JonB
                                  Apologies for the confusion. I’ve deleted the previous post and will keep my questions in one place from now on.

                                  I successfully included the library, but when I try to display the map in Qt, I encounter the following error (see screenshot). Any suggestions on how to resolve this issue?
                                  Screenshot 2.jpeg

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #28

                                  @abhishek999 You're not linking properly one of the required libs. Please show your pro file (as text).

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  1 Reply Last reply
                                  0
                                  • A Offline
                                    A Offline
                                    abhishek999
                                    wrote on last edited by abhishek999
                                    #29

                                    @jsulm

                                    
                                    QT += core gui widgets xml
                                    
                                    CONFIG += c++17
                                    
                                    # QGIS include directory
                                    INCLUDEPATH += C:/OSGeo4W/apps/qgis-ltr/include
                                    INCLUDEPATH += C:/OSGeo4W/apps/qgis/bin
                                    INCLUDEPATH += C:/OSGeo4W/apps/Qt5/bin
                                    INCLUDEPATH += C:/OSGeo4W/apps/qgis-ltr/include/qgis
                                    INCLUDEPATH += C:/OSGeo4W/share/proj/proj.db
                                    
                                    # QGIS library directory with required libraries
                                    LIBS += -LC:/OSGeo4W/apps/qgis-ltr/lib -lqgis_core -lqgis_gui -lqgis_analysis -lqgis_3d -lqgis_native
                                    
                                    SOURCES += \
                                        main.cpp \
                                        mainwindow.cpp
                                    
                                    HEADERS += \
                                        mainwindow.h
                                    
                                    FORMS += \
                                        mainwindow.ui
                                    
                                    # Default rules for deployment.
                                    qnx: target.path = /tmp/$${TARGET}/bin
                                    else: unix:!android: target.path = /opt/$${TARGET}/bin
                                    !isEmpty(target.path): INSTALLS += target
                                    
                                    jsulmJ 1 Reply Last reply
                                    0
                                    • A abhishek999

                                      @jsulm

                                      
                                      QT += core gui widgets xml
                                      
                                      CONFIG += c++17
                                      
                                      # QGIS include directory
                                      INCLUDEPATH += C:/OSGeo4W/apps/qgis-ltr/include
                                      INCLUDEPATH += C:/OSGeo4W/apps/qgis/bin
                                      INCLUDEPATH += C:/OSGeo4W/apps/Qt5/bin
                                      INCLUDEPATH += C:/OSGeo4W/apps/qgis-ltr/include/qgis
                                      INCLUDEPATH += C:/OSGeo4W/share/proj/proj.db
                                      
                                      # QGIS library directory with required libraries
                                      LIBS += -LC:/OSGeo4W/apps/qgis-ltr/lib -lqgis_core -lqgis_gui -lqgis_analysis -lqgis_3d -lqgis_native
                                      
                                      SOURCES += \
                                          main.cpp \
                                          mainwindow.cpp
                                      
                                      HEADERS += \
                                          mainwindow.h
                                      
                                      FORMS += \
                                          mainwindow.ui
                                      
                                      # Default rules for deployment.
                                      qnx: target.path = /tmp/$${TARGET}/bin
                                      else: unix:!android: target.path = /opt/$${TARGET}/bin
                                      !isEmpty(target.path): INSTALLS += target
                                      
                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #30

                                      @abhishek999 What exact Qt version did you use to build QGIS? Is it the same you're using to build the application?

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      A 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @abhishek999 What exact Qt version did you use to build QGIS? Is it the same you're using to build the application?

                                        A Offline
                                        A Offline
                                        abhishek999
                                        wrote on last edited by
                                        #31

                                        @jsulm i am using qt 5.15.2

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • A abhishek999

                                          @jsulm i am using qt 5.15.2

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #32

                                          @abhishek999 You did not answer the second question.

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          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