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. problem with subdirs(exe and link multi lib), please help
Forum Updated to NodeBB v4.3 + New Features

problem with subdirs(exe and link multi lib), please help

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
5 Posts 3 Posters 551 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.
  • Q Offline
    Q Offline
    QtTester
    wrote on last edited by
    #1

    Hi guys:
    here is my subdirs organized as follow:

    --AppCommon(dist dir, save all dll lib and header)
    --AppExe(dir , the main app)
    --AppLib1(dll /lib 1)
    --AppLib2(dll /lib 2)
    --AppSubdirs( subdirs project, like .sln in vs)

    AppExe needs include library/header file in AppCommon ,because he cannot access Applib1/Applib2 dir.
    For every dll(library) project, I write a bat file ,and it is executed in the QtCreator 'custom process step'.
    Everytime qt build AppLib1 ,the bat file will copy Applib1.lib/Applib1.lib/Applib1.h to AppCommon, so that AppExe can be linked correctly .
    Same as Applib2.

    Now I create subdirs project, the .pro file look like this:

    TEMPLATE = subdirs
    CONFIG += ordered
    
    SUBDIRS += \
        ../AppLib1 \
        ../AppLib2 \
        ../AppExe
    

    and comes the problem:
    subdirs will build every project in right sequence, after using:
    CONFIG += ordered
    But he cannot execute every bat file, so AppExe always link the old library in AppCommon dir.
    Or I can specify DESTDIR = ../../AppCommon in every dll project, so the library and dll can be output to AppCommon, but the header file still is the old one and AppExe cannot scan the newest header.

    So, How can i config the subdirs to make the library AND header file output to AppCommon ?
    Any help will be appreciated.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What is the issue with the header ?

      As for the libraries, they should rather be but in a common place in the build folder and linked from there.

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

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtTester
        wrote on last edited by
        #3

        Hi, SGaist.
        People in a team has different permission . for example , AppExe just can access the AppLib1.h in Appcommon folder, but he cannot access .\Applib1\AppLib1.h. So I need to copy the header to a Appcommon folder.

        jsulmJ 1 Reply Last reply
        0
        • Q QtTester

          Hi, SGaist.
          People in a team has different permission . for example , AppExe just can access the AppLib1.h in Appcommon folder, but he cannot access .\Applib1\AppLib1.h. So I need to copy the header to a Appcommon folder.

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

          @QtTester said in problem with subdirs(exe and link multi lib), please help:

          but he cannot access .\Applib1\AppLib1.h.

          Why not? Why such restrictions?

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

          1 Reply Last reply
          1
          • Q Offline
            Q Offline
            QtTester
            wrote on last edited by
            #5

            Finally i use Cmake or Bat to compile the projects.

            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