Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt project failing compilation with no discernible error



  • I'm porting a qt project that compiles on a MacOS to Windows. I've managed to more or less fix all of the compiler errors, but I'm now met with this:

    18 warnings generated.
    	  /OUT:debug\editor.exe @C:\Users\User\AppData\Local\Temp\editor.exe.10472.84781.jom
    The system cannot find the path specified.
    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile.Debug [debug\editor.exe] Error 1
    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile [debug] Error 2
    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\Makefile [sub-src-make_first] Error 2
    02:32:53: The process "C:\Users\User\msvc_make.bat" exited with code 2.
    Error while building/deploying project project (kit: Desktop Qt 5.12.9 MSVC2017 64bit)
    When executing step "Make"
    

    I've been looking for hours and I have no idea why this isn't being generated. I would very much like to not disable JOM if I don't have to (not that I haven't tried, setting CMake generator in the kit to NMake Makefiles with Codeblock instead of NMake Makefiles JOM with Codeblocks just gives me the same error).

    This is the part of the Makefile.debug file which seems to invoke the editor.exe:

    ####### Build rules
    
    first: all
    all: Makefile.Debug  debug\editor.exe
    
    debug\editor.exe: C:\Source\build-project-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\..\lib\cocos2d\debug\cocos2d.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5OpenGLd.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Widgetsd.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Guid.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Xmld.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Cored.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\qtmaind.lib ui_mainwindow.h ui_setprojectpathdialog.h $(OBJECTS) 
    	$(LIBAPP) $(LIBFLAGS) /OUT:$(DESTDIR_TARGET) @<<
    	  [here is a list of paths to a bunch of obj files in a debug folder]
    <<
    

    Here are the variables I was able to find:

    DESTDIR        = debug\ #avoid trailing-slash linebreak
    TARGET         = editor.exe
    DESTDIR_TARGET = debug\editor.exe
    

    OBJECTS is a list of obj files in the debug folder.

    How do I make this project compile on windows?



  • LIBAPP is unset for this particular project, although it works perfectly fine for it's dependency. Solution that I found is to just add it to the system environment in the build settings. I hate everything.



  • @Karlovsky120
    This is my guess.

    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile.Debug [debug\editor.exe] Error 1
    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile [debug] Error 2
    jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\Makefile [sub-src-make_first] Error 2
    

    This is the part of the Makefile.debug file which seems to invoke the editor.exe:

    It is not trying to "invoke" editor.exe. It is trying to open/create it for writing to, for generating the final executable from the link command line.

    I think you will find that those Error numbers are just the value of the constants in <errno.h>.

    Value 2 is ENOENT, No such file or directory. I don't know whether they are supposed to exist, but I think it's telling you debug and sub-src-make_first do not. These might be a consequence of the other error....

    ...Value 1 is EPERM, “Operation not permitted.” Only the owner of the file (or other resource) or processes with special privileges can perform the operation. This is the first error and I think the interesting one.

    I think this is telling you it is unable to open debug\editor.exe for write. I would concentrate on this. Under Windows you can get this error number for a variety of reasons (not just what the text above says).

    • Does that file exist, can you delete it?
    • If, for example, you have previously set off running editor.exe and it has not exited properly you may get this message.
    • Could there be a permission problem? You should be able to delete the whole of the debug folder and rebuild from scratch, which might sort it out?


  • Well, sub-src-make_first is mentioned in the Makefile in the root directory:

    sub-src-make_first: sub-lib-cocos2d-make_first FORCE
    	@if not exist src\ mkdir src\ & if not exist src\ exit 1
    	@set MAKEFLAGS=$(MAKEFLAGS)
    	cd src\ && ( if not exist Makefile $(QMAKE) -o Makefile C:\Source\project\src\src.pro -spec win32-clang-msvc "CONFIG+=debug" "CONFIG+=qml_debug" "CONFIG+=qtquickcompiler" "CONFIG+=force_debug_info" "CONFIG+=separate_debug_info" "DEFINES+=_WIN32 _WINDOWS CC_STATIC BT_NO_SIMD_OPERATOR_OVERLOADS _WINSOCKAPI_ Z_SOLO" ) && $(MAKE) -f Makefile
    

    debug/editor.exe doesn't exist at all, I think that is the output that the project needs to produce. I've completely deleted the output folder many times, there can't be write permission issues with windows when it so readily writes the rest of the files, unless it somehow can't specifically write *.exe files.

    The mentioned editor.exe.10472.84781.jom file also doesn't exist on that (or any other) path.



  • @Karlovsky120 said in Qt project failing compilation with no discernible error:

    editor.exe.10472.84781.jom

    That will just be a temporary file, created & removed by the make process.

    /OUT:debug\editor.exe @C:\Users\User\AppData\Local\Temp\editor.exe.10472.84781.jom

    Let's be absolutely clear: does the path C:\Users\User\AppData\Local\Temp exist (and you can create files there) or not?

    @if not exist src\ mkdir src\ & if not exist src\ exit 1

    That looks like the potential Error 1 then. Whatever directory that runs in (I don't know, so don't ask me) is there a directory named src/can it create one there? Just for example, if there were a file there named src this would fall over.



  • Yeah, the temp folder exists and I can create file no problem. I even played a game (for the first time, after I tried compiling this) last night, I can see it created files there as well too.



  • @Karlovsky120
    I just edited previous to ask about the mkdir src\ line?



  • What about that line? It seems to create src folder if it doesn't exist and crash if it can't. But it creates the folder just fine, this is where Makefile and Makefile.Debug are, along with a few others.



  • @Karlovsky120 said in Qt project failing compilation with no discernible error:

    What about that line?

    I picked that out because of the exit 1 and your first error message's Error 1. There may be other occurrences of exit 1.

    Since I don't do this stuff I will leave it to others to try to help.



  • I don't think that line is the issue. Thank you for you time anyway. :)



  • LIBAPP is unset for this particular project, although it works perfectly fine for it's dependency. Solution that I found is to just add it to the system environment in the build settings. I hate everything.


Log in to reply