Build issues with an external library's .lib files
-
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 bothaws-cpp-sdk-core.lib
andaws-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!
-
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 bothaws-cpp-sdk-core.lib
andaws-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!
@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)? -
@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)?@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