Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Build issues with an external library's .lib files
Forum Updated to NodeBB v4.3 + New Features

Build issues with an external library's .lib files

Scheduled Pinned Locked Moved Solved Installation and Deployment
3 Posts 2 Posters 362 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
    Iemon
    wrote on last edited by Iemon
    #1

    I'm trying to add an external library to my Qt project. It runs fine on my machine but can't seem to find the .lib files when deployed. I did find .dll files in the out folder, but not .lib files.

    This is how I'm adding the library (using the Qt's Add Library tool) in .pro. I tried both static and dynamic options.

    win32: LIBS += -L$$PWD/3rdparty/aws-cpp-sdk-all/bin/ -laws-cpp-sdk-core
    win32: LIBS += -L$$PWD/3rdparty/aws-cpp-sdk-all/bin/ -laws-cpp-sdk-s3
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/aws-cpp-sdk-core.lib
    else:win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/libaws-cpp-sdk-core.a
    
    win32:!win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/aws-cpp-sdk-s3.lib
    else:win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/libaws-cpp-sdk-s3.a
    
    INCLUDEPATH += $$PWD/3rdparty/aws-cpp-sdk-all/include
    DEPENDPATH += $$PWD/3rdparty/aws-cpp-sdk-all/include
    

    Error message:

    C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release
    Error: dependent 'C:\Workspace\workspace\<branch_name>\src\<app_name>\3rdparty\aws-cpp-sdk-all\bin\aws-cpp-sdk-core.lib' does not exist.
    jom: C:\Workspace\workspace\<branch_name>\build\<app_name>\Makefile [release] Error 2
    "c:\Workspace\workspace\<branch_name>\build\<app_name>\out\<app_name>.exe" does not exist.
    

    The <app_name>\3rdparty\aws-cpp-sdk-all\bin\ folder has both aws-cpp-sdk-core.lib and aws-cpp-sdk-core.dll files.

    I'm running Qt 6.3.2 with MSVC 2019 16.11.32106.194 amd64 on Windows 11. Let me know if you need to know the SDK build or deployment steps. Thanks in advance!

    jsulmJ 1 Reply Last reply
    0
    • I Iemon

      I'm trying to add an external library to my Qt project. It runs fine on my machine but can't seem to find the .lib files when deployed. I did find .dll files in the out folder, but not .lib files.

      This is how I'm adding the library (using the Qt's Add Library tool) in .pro. I tried both static and dynamic options.

      win32: LIBS += -L$$PWD/3rdparty/aws-cpp-sdk-all/bin/ -laws-cpp-sdk-core
      win32: LIBS += -L$$PWD/3rdparty/aws-cpp-sdk-all/bin/ -laws-cpp-sdk-s3
      
      win32:!win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/aws-cpp-sdk-core.lib
      else:win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/libaws-cpp-sdk-core.a
      
      win32:!win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/aws-cpp-sdk-s3.lib
      else:win32-g++: PRE_TARGETDEPS += $$PWD/3rdparty/aws-cpp-sdk-all/bin/libaws-cpp-sdk-s3.a
      
      INCLUDEPATH += $$PWD/3rdparty/aws-cpp-sdk-all/include
      DEPENDPATH += $$PWD/3rdparty/aws-cpp-sdk-all/include
      

      Error message:

      C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Release
      Error: dependent 'C:\Workspace\workspace\<branch_name>\src\<app_name>\3rdparty\aws-cpp-sdk-all\bin\aws-cpp-sdk-core.lib' does not exist.
      jom: C:\Workspace\workspace\<branch_name>\build\<app_name>\Makefile [release] Error 2
      "c:\Workspace\workspace\<branch_name>\build\<app_name>\out\<app_name>.exe" does not exist.
      

      The <app_name>\3rdparty\aws-cpp-sdk-all\bin\ folder has both aws-cpp-sdk-core.lib and aws-cpp-sdk-core.dll files.

      I'm running Qt 6.3.2 with MSVC 2019 16.11.32106.194 amd64 on Windows 11. Let me know if you need to know the SDK build or deployment steps. Thanks in advance!

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

      @Iemon said in Build issues with an external library's .lib files:

      but can't seem to find the .lib files when deployed

      *.lib files are not needed after building. On Windows *.lib files are used to link libraries when building (running linker). At runtime only *.dll files are needed.
      Are you sure you're linking correct libraries (for same architecture)?

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

      I 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Iemon said in Build issues with an external library's .lib files:

        but can't seem to find the .lib files when deployed

        *.lib files are not needed after building. On Windows *.lib files are used to link libraries when building (running linker). At runtime only *.dll files are needed.
        Are you sure you're linking correct libraries (for same architecture)?

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

        @jsulm Sorry, I didn't say it correctly. We are rebuilding the app when we deploy it to Jenkins. And... it turns out our .gitignore file was excluding all /bin files, which has the .lib files in this case. Thank you for the clarifications on the build process. I probably would've never checked it without your comment hehe

        1 Reply Last reply
        1

        • Login

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