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. windows dll install does not include lib file
QtWS25 Last Chance

windows dll install does not include lib file

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 641 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.
  • M Offline
    M Offline
    mcarter
    wrote on last edited by
    #1

    QMake version 3.1
    Qt version 5.9.7

    I have a series of libraries that build and then need to be installed into a central location for other libs and apps to access for their builds. The staticlib works fine in this respect since it is only the simple .lib (and maybe .pdb). However, with dll build seems to only install the .dll and not also the associated .lib needed for use with other builds that want to use it.

    Is there a config item or flag to trigger this copy of the .lib to the target.path?

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

      Hi,

      Did you properly export your classes ?

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

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Did you properly export your classes ?

        M Offline
        M Offline
        mcarter
        wrote on last edited by
        #3

        @SGaist Yes, using Q_DECL_EXPORT where appropriate. In the 'debug' build directory, I see:

         mylib.dll   mylib.exp   mylib.ilk   mylib.lib   mylib.pdb
        

        Then the install just grabs dll and pdb files along with all the headers that are associated with the library.

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

          Is the .lib file size non 0 ?

          Did you create a header like described here ?

          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
          • M Offline
            M Offline
            mcarter
            wrote on last edited by
            #5

            Yes, all files are non-zero:

            07/08/2022 05:17 PM 1,273,344 mylib.dll
            07/08/2022 05:17 PM 14,243 mylib.exp
            07/08/2022 05:17 PM 4,414,168 mylib.ilk
            07/08/2022 05:17 PM 23,866 mylib.lib
            07/08/2022 05:17 PM 5,320,704 mylib.pdb

            and yes, using a header just as described for Q_DECL_EXPORT

            so what should trigger the install to include the .lib file as well? Is it finding something in the code/header or having a .lib file generated during the build process? Is there an extra config item?

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

              Can you show your .pro file ?

              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
              • M Offline
                M Offline
                mcarter
                wrote on last edited by
                #7

                Ok, i think I have found the issue. You asking about .pro file had me examine it a little closer. I inherited the code that was working in linux and now trying to make it work as shared library in windows. At the top of project file was the following line:

                CONFIG += plugin  # avoid the version symlinks
                

                This will generate the .so library and not all the .so.#,#.#,#.#.# versioning symbolic links, which seem to be ok in linux. This triggers a different outcome in windows, since I assume, it expects this to be only used as a plugin and thus only the dll is a required component.

                I updated the line in the project file as follows and that seems to have done the trick:

                !win32: CONFIG += plugin  # avoid the version symlinks in non-windows build
                

                So a quick followup then. If the build produces the .dll but no .lib, then nothing was exported properly and thus the library cannot be linked with app? Seeing this in another library as part of the bigger project building in windows.

                Christian EhrlicherC 1 Reply Last reply
                1
                • M mcarter

                  Ok, i think I have found the issue. You asking about .pro file had me examine it a little closer. I inherited the code that was working in linux and now trying to make it work as shared library in windows. At the top of project file was the following line:

                  CONFIG += plugin  # avoid the version symlinks
                  

                  This will generate the .so library and not all the .so.#,#.#,#.#.# versioning symbolic links, which seem to be ok in linux. This triggers a different outcome in windows, since I assume, it expects this to be only used as a plugin and thus only the dll is a required component.

                  I updated the line in the project file as follows and that seems to have done the trick:

                  !win32: CONFIG += plugin  # avoid the version symlinks in non-windows build
                  

                  So a quick followup then. If the build produces the .dll but no .lib, then nothing was exported properly and thus the library cannot be linked with app? Seeing this in another library as part of the bigger project building in windows.

                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @mcarter said in windows dll install does not include lib file:

                  If the build produces the .dll but no .lib, then nothing was exported properly and thus the library cannot be linked with app

                  correct

                  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
                  0

                  • Login

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