Windows release build hangs during linking
-
My application uses C++ and QML, on Windows the Debug build works properly, but the release build hangs during the link phase. Using Qt 5.15.14
-
That's not much information to go on. Do you have link time optimization on for the release build?
-
@SimonSchroeder I actually don't know, where do I check that?
-
@franzhelmut
It would be "unusual" for a linker to "hang". It would suggest a bug in the linker, which is used by "millions" of people, nothing to do with Qt.I don't know anything about QML, but can't you show the complete linker command line being executed (so that we can see what it is) and any responses/hanging? In Creator there is a "Build [or Compiler] Output" pane, I kind of assume QML still goes through this route?
-
@franzhelmut Probably depends on whatever compiler/linker you are using...
-
@franzhelmut said in Windows release build hangs during linking:
I can do about that?
Reduce the number of parallel compiler jobs (processes).
If you're using make to build you can use -j NUMBER_OF_BUILD_JOBS parameter. -
@franzhelmut said in Windows release build hangs during linking:
I just tried it again with link optimization on and now I get the message that the compiler ran out of heap space.
I was asking if you have link time optimization on because it could either use up a lot of RAM or it could just take an insane amount of time to link, i.e. it "hangs". That would've been an explanation and was not meant as a suggestion to turn it on. Since you now turned it on means you didn't have it before. So, this does not seem to have been your problem.
As @JonB suggested you should share the complete linker command so we can have a look at it.
-
@franzhelmut qmake either generates make files or (on Windows) files for Ninja. So, do you use make or Ninja? If you do not know then look into the build folder and see whether you find Makefile inside or something like Ninja.build.
-
@franzhelmut Then try to reduce the amount of parallel builds using -j parameter like I suggested before.
-
Also make sure you're using the 64bit cl.exe and not the 32bit one.
-
@franzhelmut this process works on my Windows10 PC, with the 2015 compiler. On Windows11 I cannot install the 2015 compiler. The 2019 compiler seems to need more resources like heap space.