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. Include code from GitHub in Qt project
Forum Update on Monday, May 27th 2025

Include code from GitHub in Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 4 Posters 704 Views
  • 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.
  • Q Offline
    Q Offline
    Qtpp
    wrote on 6 Jul 2023, 17:37 last edited by Qtpp 7 Jun 2023, 18:10
    #1

    Hi there,

    I'm new to Qt and relatively new to C++.
    How can I add libraries/code I pulled from GitHub (or somewhere else) to my QMake project?
    There are no .lib files, so the Wizard in QtCreator to add dynamic libraries doesn't work.
    I already added the INCLUDEPATH to my .pro file and I managed to include the headers, I need... and now?!
    I still get undefinded reference to ..... messages when using functions from there.
    Do I need to compile the whole code from GitHub myself? The folders I pulled, contain dozens of subfolders and lots of headers.

    Any help appreciated

    S 1 Reply Last reply 6 Jul 2023, 18:00
    0
    • Q Qtpp
      6 Jul 2023, 18:19

      @Christian-Ehrlicher

      Oh, well... What's the best way to do so?
      I'm using QtCreator and minGW on Windows 10.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 6 Jul 2023, 18:21 last edited by
      #6

      Either build and install it by yourself or write a proper ExternalProject_add() script for it and use this.

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

      Q 1 Reply Last reply 6 Jul 2023, 18:44
      0
      • Q Qtpp
        6 Jul 2023, 17:37

        Hi there,

        I'm new to Qt and relatively new to C++.
        How can I add libraries/code I pulled from GitHub (or somewhere else) to my QMake project?
        There are no .lib files, so the Wizard in QtCreator to add dynamic libraries doesn't work.
        I already added the INCLUDEPATH to my .pro file and I managed to include the headers, I need... and now?!
        I still get undefinded reference to ..... messages when using functions from there.
        Do I need to compile the whole code from GitHub myself? The folders I pulled, contain dozens of subfolders and lots of headers.

        Any help appreciated

        S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 6 Jul 2023, 18:00 last edited by
        #2

        Hi and welcome to devnet,

        Did you build and install that library ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        Q 1 Reply Last reply 6 Jul 2023, 18:08
        1
        • S SGaist
          6 Jul 2023, 18:00

          Hi and welcome to devnet,

          Did you build and install that library ?

          Q Offline
          Q Offline
          Qtpp
          wrote on 6 Jul 2023, 18:08 last edited by
          #3

          @SGaist

          I pulled the code via git pull into my "D:/dev/lib/" directory where I want to collect all additonal libs I'm planning to use and added that path to INCLUDEPATH.

          So I have to build the library separately?!
          I thought I can just include and "use" the headers from there since I pointed to the place where all the code from GitHub is located?

          C 1 Reply Last reply 6 Jul 2023, 18:11
          0
          • Q Qtpp
            6 Jul 2023, 18:08

            @SGaist

            I pulled the code via git pull into my "D:/dev/lib/" directory where I want to collect all additonal libs I'm planning to use and added that path to INCLUDEPATH.

            So I have to build the library separately?!
            I thought I can just include and "use" the headers from there since I pointed to the place where all the code from GitHub is located?

            C Offline
            C Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on 6 Jul 2023, 18:11 last edited by
            #4

            @Qtpp said in Include code from GitHub in Qt project:

            So I have to build the library separately?!

            Yes

            I thought I can just include and "use" the headers from there since I pointed to the place where all the code from GitHub is located?

            Github normally provides source code in the git repos, not pre-compiled libraries.

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

            Q 1 Reply Last reply 6 Jul 2023, 18:19
            2
            • C Christian Ehrlicher
              6 Jul 2023, 18:11

              @Qtpp said in Include code from GitHub in Qt project:

              So I have to build the library separately?!

              Yes

              I thought I can just include and "use" the headers from there since I pointed to the place where all the code from GitHub is located?

              Github normally provides source code in the git repos, not pre-compiled libraries.

              Q Offline
              Q Offline
              Qtpp
              wrote on 6 Jul 2023, 18:19 last edited by
              #5

              @Christian-Ehrlicher

              Oh, well... What's the best way to do so?
              I'm using QtCreator and minGW on Windows 10.

              C 1 Reply Last reply 6 Jul 2023, 18:21
              0
              • Q Qtpp
                6 Jul 2023, 18:19

                @Christian-Ehrlicher

                Oh, well... What's the best way to do so?
                I'm using QtCreator and minGW on Windows 10.

                C Offline
                C Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on 6 Jul 2023, 18:21 last edited by
                #6

                Either build and install it by yourself or write a proper ExternalProject_add() script for it and use this.

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

                Q 1 Reply Last reply 6 Jul 2023, 18:44
                0
                • C Christian Ehrlicher
                  6 Jul 2023, 18:21

                  Either build and install it by yourself or write a proper ExternalProject_add() script for it and use this.

                  Q Offline
                  Q Offline
                  Qtpp
                  wrote on 6 Jul 2023, 18:44 last edited by
                  #7

                  @Christian-Ehrlicher

                  Are there any good tutorials how to do this?

                  jsulmJ 1 Reply Last reply 7 Jul 2023, 05:22
                  0
                  • Q Qtpp
                    6 Jul 2023, 18:44

                    @Christian-Ehrlicher

                    Are there any good tutorials how to do this?

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 7 Jul 2023, 05:22 last edited by
                    #8

                    @Qtpp said in Include code from GitHub in Qt project:

                    Are there any good tutorials how to do this?

                    Many project provide a text file in their repository describing how to build - did you check that? You did not even say whether this project uses CMake, QMake or something else...

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

                    Q 1 Reply Last reply 8 Jul 2023, 19:45
                    1
                    • jsulmJ jsulm
                      7 Jul 2023, 05:22

                      @Qtpp said in Include code from GitHub in Qt project:

                      Are there any good tutorials how to do this?

                      Many project provide a text file in their repository describing how to build - did you check that? You did not even say whether this project uses CMake, QMake or something else...

                      Q Offline
                      Q Offline
                      Qtpp
                      wrote on 8 Jul 2023, 19:45 last edited by
                      #9

                      @jsulm said in Include code from GitHub in Qt project:

                      You did not even say whether this project uses CMake, QMake or something else...

                      The GitHub project contains a CMakeLists.txt
                      I'm using QMake (Qt5.15 with QtCreator).

                      I tried to build the library or code from GitHub using CMake GUI, but it failed.

                      Will look for alternatives or any pre-compiled library where I can include the *.lib directly.

                      Thank you all :)

                      jsulmJ 1 Reply Last reply 10 Jul 2023, 05:47
                      0
                      • Q Qtpp has marked this topic as solved on 8 Jul 2023, 19:46
                      • Q Qtpp
                        8 Jul 2023, 19:45

                        @jsulm said in Include code from GitHub in Qt project:

                        You did not even say whether this project uses CMake, QMake or something else...

                        The GitHub project contains a CMakeLists.txt
                        I'm using QMake (Qt5.15 with QtCreator).

                        I tried to build the library or code from GitHub using CMake GUI, but it failed.

                        Will look for alternatives or any pre-compiled library where I can include the *.lib directly.

                        Thank you all :)

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on 10 Jul 2023, 05:47 last edited by
                        #10

                        @Qtpp said in Include code from GitHub in Qt project:

                        but it failed

                        This does not help to understand and solve the problem.
                        You should provide more details...

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

                        1 Reply Last reply
                        0

                        1/10

                        6 Jul 2023, 17:37

                        • Login

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