Important: Please read the Qt Code of Conduct -

[SOLVED] QT compling - error 740

  • Hello,

    I am having trouble with a fresh install of QT Creator, this is my first time using it.
    When I press compile I get this error:

    03:49:39: Running steps for project calendar...
    03:49:39: Starting: "D:\Program Files\QT\5.5\mingw492_32\bin\qmake.exe" "D:\Program Files\QT\Examples\Qt-5.5\quick\controls\calendar\" -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug"
    03:49:39: The process "D:\Program Files\QT\5.5\mingw492_32\bin\qmake.exe" exited normally.
    03:49:39: Starting: "D:\Program Files\QT\Tools\mingw492_32\bin\mingw32-make.exe" 
    D:/Program Files/QT/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'D:/Program Files/QT/Examples/Qt-5.5/quick/controls/build-calendar-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    process_begin: CreateProcess(NULL, D:/Program Files/Git/bin/sh.exe -c "g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../calendar -I. -I../shared -I\"D:/Program Files/QT/5.5/mingw492_32/include\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtQuick\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtWidgets\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtGui\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtANGLE\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtQml\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtNetwork\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtSql\" -I\"D:/Program Files/QT/5.5/mingw492_32/include/QtCore\" -Idebug -I\"D:/Program Files/QT/5.5/mingw492_32/mkspecs/win32-g++\"  -o debug/event.o ../calendar/src/event.cpp", ...) failed.
    make (e=740): The requested operation requires elevation.
    mingw32-make[1]: *** [debug/event.o] Error 740
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../calendar -I. -I../shared -I"D:/Program Files/QT/5.5/mingw492_32/include" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtQuick" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtWidgets" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtGui" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtANGLE" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtQml" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtNetwork" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtSql" -I"D:/Program Files/QT/5.5/mingw492_32/include/QtCore" -Idebug -I"D:/Program Files/QT/5.5/mingw492_32/mkspecs/win32-g++"  -o debug/event.o ../calendar/src/event.cpp
    Makefile.Debug:343: recipe for target 'debug/event.o' failed
    mingw32-make[1]: Leaving directory 'D:/Program Files/QT/Examples/Qt-5.5/quick/controls/build-calendar-Desktop_Qt_5_5_0_MinGW_32bit-Debug'
    makefile:34: recipe for target 'debug' failed
    mingw32-make: *** [debug] Error 2
    03:49:39: The process "D:\Program Files\QT\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project calendar (kit: Desktop Qt 5.5.0 MinGW 32bit)
    When executing step "Make"
    03:49:39: Elapsed time: 00:01.

    I am running an example code from an calendar with no changes made to it at all, but it doesn't look like it's an error in the code.

    Does anyone know how to fix this problem?

  • Moderators


    @uruloke said:

    CreateProcess(NULL, D:/Program Files/Git/bin/sh.exe -c "g++ ...")

    mingw32-make detected sh.exe in your PATH, and now it wants to use sh.exe instead of cmd.exe. Windows doesn't allow that.

    Remove D:\Program Files\Git\bin from your PATH.

  • @JKSH

    Thank you, it worked to remove Git from my PATH. Now I just have to configure Git manually in all my other applications that uses Git.

  • Moderators

    Hi @uruloke, I'm assuming you installed Git from If so, you could still have Git in your PATH by adding D:\Program Files\Git\cmd to your PATH. Don't add D:\Program Files\Git\bin.

    And next time you install Git, select "Use Git from the Windows Command Prompt". Don't select "Use Git and optional Unix tools from the Windows Command Prompt" -- this option causes problems like your error 740 (notice the big red warning for this option)

    Git PATH options

    Another option is to use Visual Studio instead of MinGW. Visual Studio doesn't have problems with sh.exe.

  • @JKSH
    Thank you for clarifying what's causing the error.
    I will work around this then, so I can set it up accordingly to how I wanna use it.

Log in to reply