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. How to put dynamic library project in one project
Forum Updated to NodeBB v4.3 + New Features

How to put dynamic library project in one project

Scheduled Pinned Locked Moved Solved General and Desktop
10 Posts 2 Posters 874 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    Is there a way to put a dynamic library project in one project? Taking Visual Studio as an example, the main project and the library project can be used together in the project, but I wonder if it can be used in QT creator as well.

    jsulmJ 1 Reply Last reply
    0
    • I IknowQT

      @jsulm

      I think the simplest way to create a project in qt and load it into VS2019 is to create a subProject in Qt Creator.

      bbda4a7d-1f56-4a27-850f-977b0372c720-image.png

      Finally, what I want to do is manage the project that creates the executable file and the dynamic library project in one project.

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

      @IknowQT Is there a question in your last post?
      "New Subproject" is greyed out because Qt_libTEST is NOT a subdirs project!
      You first need to create a subdirs project, then add your lib project as subproject there and then add your exe project as subproject.
      You could also spend some time reading the link I gave you to understand how subdir projects work...

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

      I 1 Reply Last reply
      0
      • I IknowQT

        Is there a way to put a dynamic library project in one project? Taking Visual Studio as an example, the main project and the library project can be used together in the project, but I wonder if it can be used in QT creator as well.

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

        @IknowQT https://wiki.qt.io/SUBDIRS_-_handling_dependencies
        https://riptutorial.com/qt/example/16535/subdirs-example

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

        I 1 Reply Last reply
        0
        • jsulmJ jsulm

          @IknowQT https://wiki.qt.io/SUBDIRS_-_handling_dependencies
          https://riptutorial.com/qt/example/16535/subdirs-example

          I Offline
          I Offline
          IknowQT
          wrote on last edited by
          #3

          @jsulm

          I think the simplest way to create a project in qt and load it into VS2019 is to create a subProject in Qt Creator.

          bbda4a7d-1f56-4a27-850f-977b0372c720-image.png

          Finally, what I want to do is manage the project that creates the executable file and the dynamic library project in one project.

          jsulmJ 1 Reply Last reply
          0
          • I IknowQT

            @jsulm

            I think the simplest way to create a project in qt and load it into VS2019 is to create a subProject in Qt Creator.

            bbda4a7d-1f56-4a27-850f-977b0372c720-image.png

            Finally, what I want to do is manage the project that creates the executable file and the dynamic library project in one project.

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

            @IknowQT Is there a question in your last post?
            "New Subproject" is greyed out because Qt_libTEST is NOT a subdirs project!
            You first need to create a subdirs project, then add your lib project as subproject there and then add your exe project as subproject.
            You could also spend some time reading the link I gave you to understand how subdir projects work...

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

            I 1 Reply Last reply
            0
            • jsulmJ jsulm

              @IknowQT Is there a question in your last post?
              "New Subproject" is greyed out because Qt_libTEST is NOT a subdirs project!
              You first need to create a subdirs project, then add your lib project as subproject there and then add your exe project as subproject.
              You could also spend some time reading the link I gave you to understand how subdir projects work...

              I Offline
              I Offline
              IknowQT
              wrote on last edited by
              #5

              @jsulm

              Thank you. It worked out well.
              Is there a flag that separates debug and release in the .pro file when building?

              jsulmJ 1 Reply Last reply
              0
              • I IknowQT

                @jsulm

                Thank you. It worked out well.
                Is there a flag that separates debug and release in the .pro file when building?

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

                @IknowQT Not sure I understand your question correctly. If you need to differentiate between debug and release inside your pro files, then yes, see https://doc.qt.io/qt-5/qmake-language.html
                When building you just define whether you want to build in debug or release mode.

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

                I 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @IknowQT Not sure I understand your question correctly. If you need to differentiate between debug and release inside your pro files, then yes, see https://doc.qt.io/qt-5/qmake-language.html
                  When building you just define whether you want to build in debug or release mode.

                  I Offline
                  I Offline
                  IknowQT
                  wrote on last edited by
                  #7

                  @jsulm

                  I found a way to distinguish between release and debug in config.

                  CONFIG(debug, debug|release) {
                      DESTDIR = $$PWD/../Depoly_Exec/debug 
                  } else {
                      DESTDIR = $$PWD/../Depoly_Exec/release
                  }
                  

                  When built, exp,ilk,pdb files are also created, and these files don't need to be in the distribution folder, so I want to move only the dll file and the lib file to the distribution folder. What should I do?

                  jsulmJ 1 Reply Last reply
                  0
                  • I IknowQT

                    @jsulm

                    I found a way to distinguish between release and debug in config.

                    CONFIG(debug, debug|release) {
                        DESTDIR = $$PWD/../Depoly_Exec/debug 
                    } else {
                        DESTDIR = $$PWD/../Depoly_Exec/release
                    }
                    

                    When built, exp,ilk,pdb files are also created, and these files don't need to be in the distribution folder, so I want to move only the dll file and the lib file to the distribution folder. What should I do?

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

                    @IknowQT said in How to put dynamic library project in one project:

                    What should I do?

                    Build in release mode.
                    In which mode did you build?
                    qmake PATH_TO_PROJECT.pro -spec linux-g++

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

                    I 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @IknowQT said in How to put dynamic library project in one project:

                      What should I do?

                      Build in release mode.
                      In which mode did you build?
                      qmake PATH_TO_PROJECT.pro -spec linux-g++

                      I Offline
                      I Offline
                      IknowQT
                      wrote on last edited by
                      #9

                      @jsulm

                      I built it in debug mode.
                      I want to exclude files from being created.

                      jsulmJ 1 Reply Last reply
                      0
                      • I IknowQT

                        @jsulm

                        I built it in debug mode.
                        I want to exclude files from being created.

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

                        @IknowQT said in How to put dynamic library project in one project:

                        I want to exclude files from being created

                        Then do so. What is the problem?

                        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