qmake generating bogus makefile
-
hi
I have recently did an msvc2019 32 bit build of qt 5.15 from source along with Mysql sql driver plugin using mariadb c connector.now using this kit in qt-creator to create a basic qt widget application, i get a link error in all but console configs:
:-1: error: LNK1181: cannot open input file 'C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib.obj'
I narrowed this down to the makefile's LIBS being :
LIBS = C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Widgetsd.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Guid.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Cored.lib glu32.lib opengl32.lib gdi32.lib user32.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\qtmaind.lib /LIBPATH:"C:\Program Files (x86)\MariaDB\MariaDB Connector C\lib" C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib shell32.libremoving manually this line temporarily solves the problem
So why is this line always added automatically? and how to fix this ?
similarly why is the mariadb connector also automatically included? (though it's not causing any problem )
Notice if i do a console build, all these unnecessary dependencies are not added
thanks
-
hi
I have recently did an msvc2019 32 bit build of qt 5.15 from source along with Mysql sql driver plugin using mariadb c connector.now using this kit in qt-creator to create a basic qt widget application, i get a link error in all but console configs:
:-1: error: LNK1181: cannot open input file 'C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib.obj'
I narrowed this down to the makefile's LIBS being :
LIBS = C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Widgetsd.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Guid.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Cored.lib glu32.lib opengl32.lib gdi32.lib user32.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\qtmaind.lib /LIBPATH:"C:\Program Files (x86)\MariaDB\MariaDB Connector C\lib" C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib shell32.libremoving manually this line temporarily solves the problem
So why is this line always added automatically? and how to fix this ?
similarly why is the mariadb connector also automatically included? (though it's not causing any problem )
Notice if i do a console build, all these unnecessary dependencies are not added
thanks
As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.
-
As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.
@Christian-Ehrlicher Can i know what spaces exactly? should i recompile qt?
-
As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.
@Christian-Ehrlicher Ok i did recompile without the mariadb c connector so no spaces anywhere now, but i'm still getting this like added(C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib ) which is causing the linker error?
-
@Christian-Ehrlicher Ok i did recompile without the mariadb c connector so no spaces anywhere now, but i'm still getting this like added(C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib ) which is causing the linker error?
-
@JonB hi sure here it is:
link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /MANIFEST:embed /OUT:debug\tester.exe @C:\Users\server\AppData\Local\Temp\tester.exe.612.0.jom
LINK : fatal error LNK1104: cannot open file 'C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib.obj'"C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32" is where i installed qt compiled from source.
again the issue is that qmake is automatically adding C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib to the LIBS variable when generating the makefile but this is clearly a PATH not a library. The linker is therefore looking for lib.obj library which obviously does not exist
here's the relevant section in the makefile:
LIBS = C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Widgetsd.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Guid.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\Qt5Cored.lib glu32.lib opengl32.lib gdi32.lib user32.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib\qtmaind.lib C:\Qt\qt-5.15.8-dynamic-msvc2019-x86_32\lib shell32.lib