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. qmake generating bogus makefile
Forum Updated to NodeBB v4.3 + New Features

qmake generating bogus makefile

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 418 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.
  • D Offline
    D Offline
    dredqt
    wrote on last edited by
    #1

    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.lib

    removing 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

    Christian EhrlicherC 1 Reply Last reply
    0
    • D dredqt

      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.lib

      removing 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

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      D 2 Replies Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.

        D Offline
        D Offline
        dredqt
        wrote on last edited by
        #3

        @Christian-Ehrlicher Can i know what spaces exactly? should i recompile qt?

        1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          As always - avoid spaces in your paths like a plaque. Nice example on what can happen otherwise.

          D Offline
          D Offline
          dredqt
          wrote on last edited by
          #4

          @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?

          JonBJ 1 Reply Last reply
          0
          • D dredqt

            @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?

            JonBJ Online
            JonBJ Online
            JonB
            wrote on last edited by
            #5

            @dredqt
            Please show your full, new linker line and the error.

            D 1 Reply Last reply
            0
            • JonBJ JonB

              @dredqt
              Please show your full, new linker line and the error.

              D Offline
              D Offline
              dredqt
              wrote on last edited by
              #6

              @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

              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