1

I am unable to compile a simple Qt project (an example with the mainwindow). I tried it via command shell and also on QtCreator. first qmake should create makefile with the command rule uic to translate as simple as it should my ui to a .h.

Qt Creator indicating the below warning / error messages on the console.

09:06:30: Running steps for project untitled...
09:06:30: Starting: "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" C:\workspace_llb_27-05-2016\untitled\untitled.pro -r -spec win32-g++
09:06:32: The process "D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe" exited normally.
09:06:32: Starting: "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" 
C:/mingw/mingwx64_481r0-sjlj-rev2/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
/C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h
Makefile.Debug:318: recipe for target 'ui_mainwindow.h' failed
process_begin: CreateProcess(NULL, /C/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.sh ../workspace_llb_27-05-2016/untitled/mainwindow.ui -o ui_mainwindow.h, ...) failed.
make (e=2): Le fichier spécifié est introuvable.

mingw32-make[1]: *** [ui_mainwindow.h] Error 2
mingw32-make[1]: Leaving directory 'C:/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 2
09:06:33: The process "C:\mingw\mingwx64_481r0-sjlj-rev2\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled (kit: Qt 5.6.0 (Built by mingwx64_481r0-sjlj-rev2))
When executing step "Make"

Thanks

user12345
  • 661
  • 8
  • 34
Loki
  • 43
  • 1
  • 6
  • For some reason it looks like ui_mainwindow.h in not present, probably uic_wrapper was not able to generate it. I suggest to try compile separately only mainwindow.ui and see if that works. – Marco Jun 30 '16 at 07:55
  • Thanks for your reply Marco. it seems not working. I open command prompt where I got ui_wrapper.bat and my mainwindow.ui then I run the command line uic_wrapper.bat -o mainwindow.ui ui_mainwindow.h but It doesn't work and it should be the makefile which invock the uic.exe – Loki Jun 30 '16 at 09:19

2 Answers2

3

I find the solution eventually. If It happens to me it could happen to anyone. Actually everything have worked before I install gitbash. I set as variable system the bin of gitbash to my path system. However gitbach contains sh.exe which unix tool. So everytime I build via Qtcreator or console 2 uic_wrapper were created one .sh one .bat and all my makefile were unix like. in nutshell never set any UNIX TOOL TO YOUR WINDOWS SYSTEM. Mingw could contain MSYS take care !! at least most of tools oriented development are UNIX like.

Loki
  • 43
  • 1
  • 6
  • Wow thanks, it solved my problem. I've removed sh.exe from the path then run Qmake again, and now the Makefile use Windows commands instead of Unix (e.g. cp => copy, rm => remove etc). – fbonnet Jan 13 '17 at 10:00
1

I am suspecting something wrong with your Desktop Kit maybe. I tried to create a new default mainwindow project just like how you did and I see the first few steps like below:

14:48:15: Running steps for project untitled...
14:48:15: Starting: "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" C:\untitled\untitled.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
14:48:16: The process "D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe" exited normally.
14:48:16: Starting: "D:\Qt\Qt5.6.0\Tools\mingw492_32\bin\mingw32-make.exe" 
D:/Qt/Qt5.6.0/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug

You can notice there's a difference between the qmake path my application is using compared to yours.

Mine looks like this: D:\Qt\Qt5.6.0\5.6\mingw49_32\bin\qmake.exe
Yours looks like this: D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe

And I guess qt-everywhere-opensource-src-5.6.0 looks like the Qt source code that you might have pulled from web. Hope this information gives you some pointer to figure out what's going wrong.

user12345
  • 661
  • 8
  • 34
  • thanks a lot for your help. I never notice that point. My true path to Qt tools is D:\QT\qt-everywhere-opensource-src-5.6.0\qtbase\bin\qmake.exe. and it generate the uic_wrapper.bat correctly in my build directory but failed in the makefile.Debug. but when I run uic_wrapper.bat like this : uic_wrapper.bat -o ui_mainwindow.h mainwindow.ui. I can get in outfile my ui_mainwindow.h and then run my project. I don't know where is the cruft – Loki Jun 30 '16 at 09:39
  • 1
    I notice something in the makefile. Even If I launch the qmake like this : qmake.exe untitled.pro -r -spec win32-g++ I could find linux command like rm -f or the \ instead of / in makefile. what the heck the qmake uses linux command when creating makefile. – Loki Jun 30 '16 at 09:53
  • I'm still trying to solve this issue. I'm quiet sure it comes from the wrong environement. I change in the makefile.debug uic_wrapper.sh to .bat but nothing change yet. Here my output console in qtcreator. – Loki Jun 30 '16 at 11:35
  • /build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.bat ../untitled/mainwindow.ui -o ui_mainwindow.h Makefile.Debug:318: recipe for target 'ui_mainwindow.h' failed process_begin: CreateProcess(NULL, /C/workspace_llb_27-05-2016/build_untitled_Qt_5_6_0_Built_by_mingwx64_481r0_sjlj_rev2_Debug/uic_wrapper.bat ../untitled/mainwindow.ui -o ui_mainwindow.h, ...) failed. make (e=2): Le fichier spécifié est introuvable. – Loki Jun 30 '16 at 11:38
  • Try to check this [POST](http://stackoverflow.com/questions/10434064/qt-error-2-at-compile-time) if that can provide some clue. If it does not help, can you give me the screenshot of your desktop kit you are using. You can find that under `tools->options->build & run->kits->(desktop kit or similar)` – user12345 Jun 30 '16 at 12:54
  • I'm not enough reputation to add more. But nothing change. The only way to make it work is to launch in command line the ui_wrapper.bat.. – Loki Jun 30 '16 at 14:53