Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Simple application runs in release, but debug gives me a linkage error
Qt 6.12 LTS is out! See what's new in the release blog

Simple application runs in release, but debug gives me a linkage error

Scheduled Pinned Locked Moved Solved General and Desktop
12 Posts 4 Posters 5.9k Views 1 Watching
  • 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
    Dan Bumbarger
    wrote on last edited by
    #1

    I am getting started learning QT using the most recent and freshly installed version of QT creator on a 64 bit windows system. If I make a simple hello world application, it compiles and runs just fine in release mode, but if I try and run it in debug mode it gives me an LNK1104: cannot open file 'qtmaind.lib'. Any ideas on what I can do to figure this out?

    K JonBJ 2 Replies Last reply
    0
    • D Dan Bumbarger

      I am getting started learning QT using the most recent and freshly installed version of QT creator on a 64 bit windows system. If I make a simple hello world application, it compiles and runs just fine in release mode, but if I try and run it in debug mode it gives me an LNK1104: cannot open file 'qtmaind.lib'. Any ideas on what I can do to figure this out?

      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @Dan-Bumbarger

      Hi and welcome to devnet forum

      Did you right click on the project in the project pane and rerun qmake?
      Do a rebuild after this.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dan Bumbarger
        wrote on last edited by
        #3

        Thanks for the response! I had already tried that, but went ahead and tried again to no avail.. I've also tried it on both console and widget applications, same unfortunate result.

        K 1 Reply Last reply
        0
        • D Dan Bumbarger

          Thanks for the response! I had already tried that, but went ahead and tried again to no avail.. I've also tried it on both console and widget applications, same unfortunate result.

          K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          @Dan-Bumbarger

          Sounds something with your setup is mixed up.

          What is the pre-compiled version you using?

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          1
          • D Offline
            D Offline
            Dan Bumbarger
            wrote on last edited by
            #5

            I used the online installer, which installed this version:

            Qt Creator 4.4.1
            Based on Qt 5.9.2 (MSVC 2015, 32 bit)

            Built on Oct 4 2017 04:12:53

            From revision 6afdb8bdf9

            Does it matter that it installed based on MSVC 2015 32 bit rather than 64 bit?

            jsulmJ 1 Reply Last reply
            0
            • D Dan Bumbarger

              I used the online installer, which installed this version:

              Qt Creator 4.4.1
              Based on Qt 5.9.2 (MSVC 2015, 32 bit)

              Built on Oct 4 2017 04:12:53

              From revision 6afdb8bdf9

              Does it matter that it installed based on MSVC 2015 32 bit rather than 64 bit?

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

              @Dan-Bumbarger This is QtCreator version not Qt version.
              Which exact Qt version do you use?
              MSVC 2015 32 is fine even on 64bit Windows.

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

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dan Bumbarger
                wrote on last edited by
                #7

                I'm running 5.9.2..

                K 1 Reply Last reply
                0
                • D Dan Bumbarger

                  I'm running 5.9.2..

                  K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  @Dan-Bumbarger

                  I would suggest to post the compile and link output for a small "hello world" program. Possibly someone can see the eventual differences and why the error occurs.

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  1
                  • D Dan Bumbarger

                    I am getting started learning QT using the most recent and freshly installed version of QT creator on a 64 bit windows system. If I make a simple hello world application, it compiles and runs just fine in release mode, but if I try and run it in debug mode it gives me an LNK1104: cannot open file 'qtmaind.lib'. Any ideas on what I can do to figure this out?

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @Dan-Bumbarger
                    qtmaind.lib will be a debug library; in release build it will doubtless use qtmain.lib instead. In some shape or form it can find the latter but not the former. You might look at Qt area to see if & where you can find either/both of these files.

                    If it's quick & easy to do, you might uninstall your Qt and reinstall, just to see if it fixes or you get any error messages while installing.

                    1 Reply Last reply
                    2
                    • D Offline
                      D Offline
                      Dan Bumbarger
                      wrote on last edited by
                      #10

                      From the compile output:
                      "
                      link /LIBPATH:"c:\Users\acrob\Anaconda3\Library\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /OUT:debug\playingqtwidgets.exe @C:\Users\acrob\AppData\Local\Temp\playingqtwidgets.exe.17396.969.jom
                      LINK : fatal error LNK1104: cannot open file 'qtmaind.lib'
                      jom: C:\Users\acrob\Documents\build-playingqtwidgets-Desktop-Debug\Makefile.Debug [debug\playingqtwidgets.exe] Error 1104
                      jom: C:\Users\acrob\Documents\build-playingqtwidgets-Desktop-Debug\Makefile [debug] Error 2
                      18:38:04: The process "C:\Qt\Qt5.9.2\Tools\QtCreator\bin\jom.exe" exited with code 2.
                      "

                      and there is indeed no qtmaind.lib (there is a qtmain for release..). Strange thing is, I don't remember the option for the install telling it to install everything in Anaconda? My intention is mostly to be using it with C++ in either QTcreator or Visual Studio, though I already had Anaconda installed for a python project..

                      D 1 Reply Last reply
                      0
                      • D Dan Bumbarger

                        From the compile output:
                        "
                        link /LIBPATH:"c:\Users\acrob\Anaconda3\Library\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /OUT:debug\playingqtwidgets.exe @C:\Users\acrob\AppData\Local\Temp\playingqtwidgets.exe.17396.969.jom
                        LINK : fatal error LNK1104: cannot open file 'qtmaind.lib'
                        jom: C:\Users\acrob\Documents\build-playingqtwidgets-Desktop-Debug\Makefile.Debug [debug\playingqtwidgets.exe] Error 1104
                        jom: C:\Users\acrob\Documents\build-playingqtwidgets-Desktop-Debug\Makefile [debug] Error 2
                        18:38:04: The process "C:\Qt\Qt5.9.2\Tools\QtCreator\bin\jom.exe" exited with code 2.
                        "

                        and there is indeed no qtmaind.lib (there is a qtmain for release..). Strange thing is, I don't remember the option for the install telling it to install everything in Anaconda? My intention is mostly to be using it with C++ in either QTcreator or Visual Studio, though I already had Anaconda installed for a python project..

                        D Offline
                        D Offline
                        Dan Bumbarger
                        wrote on last edited by
                        #11

                        I am thinking that hte QT5.9.2 did not install correctly (I can't find any qtmain.exe in there..) , so it finds the only installation that it can, which is the one that installed with Anaconda.. I am going to try and uninstall, reinstall and pay closer to options...

                        D 1 Reply Last reply
                        0
                        • D Dan Bumbarger

                          I am thinking that hte QT5.9.2 did not install correctly (I can't find any qtmain.exe in there..) , so it finds the only installation that it can, which is the one that installed with Anaconda.. I am going to try and uninstall, reinstall and pay closer to options...

                          D Offline
                          D Offline
                          Dan Bumbarger
                          wrote on last edited by
                          #12

                          Yup, that's what it was... opening up the "QT" tickbox in the installer, I could see that it installed nothing but hte toolbox, likely because it had found this old version. Problem solved! I appreciate the friendly kick in the right direction!

                          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
                          • Unsolved