Qt 5.0.1 for Windows 32-bit (MinGW 4.7) example project compilation error



  • Clean install of Qt 5.0.1 to Win 7 64-bit. It gives the following compilation error for calculator example project:

    @C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe -spec win32-g++ CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug -o Makefile ..\calculator\calculator.pro
    C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.1/5.0.1/mingw47_32/examples/widgets/widgets/calculator-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\calculator -I"........\include" -I"........\include\QtWidgets" -I"........\include\QtGui" -I"........\include\QtCore" -I"debug" -I"." -I"........\mkspecs\win32-g++" -o debug\button.o ..\calculator\button.cpp
    1 [main] sh 5768 tty_list::allocate_tty: No tty allocated
    g++.exe: error: ..calculatorbutton.cpp: No such file or directory
    g++.exe: fatal error: no input files
    compilation terminated.@

    Where's the problem ?



  • [quote author="jtmz" date="1360839035"]
    Where's the problem ?
    [/quote]

    According to the attached log the problem is here:
    @g++.exe: error: ..calculatorbutton.cpp: No such file or directory@

    Have you modified the example? I don't see file calculatorbutton.cpp at "the original source of the example":http://qt-project.org/doc/qt-5.0/qtwidgets/widgets-calculator.html



  • :) yes I know it's there, maybe I should ask what makes this happen?

    Example is as it was after installation, no modifications. This happens also with a new projects. So if the name of the new project is test and first file to compile is main.cpp it gives error:

    g++.exe: error: ..testmain.cpp: No such file or directory

    So it somehow combines the project name and compiled file name?



  • I have similar problem. I got similar error messages with any new created project (Qt gui or console) on Windows 7 64 bit platform. I am using Qt 5.0.1 with 32 bit mingw. On linux it is working well.

    21:02:08: Running steps for project qt5_gui...
    21:02:08: Starting: "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe" C:\Users\Zoltan\Documents\Programming\qt5_gui\qt5_gui.pro -r -spec win32-g++ "CONFIG+=debug" "CONFIG+=declarative_debug" "CONFIG+=qml_debug"
    21:02:09: The process "C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\qmake.exe" exited normally.
    21:02:09: Starting: "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe"
    C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory 'C:/Users/Zoltan/Documents/Programming/qt5_gui-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
    C:\Qt\Qt5.0.1\5.0.1\mingw47_32\bin\uic.exe ..\qt5_gui\mainwindow.ui -o ui_mainwindow.h
    g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_OPENGL_ES_2 -DQT_OPENGL_ES_2_ANGLE -DQT_NEEDS_QMAIN -I..\qt5_gui -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtGui" -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtCore" -I"debug" -I"." -I"." -I"..........\Qt\Qt5.0.1\5.0.1\mingw47_32\mkspecs\win32-g++" -o debug\main.o ..\qt5_gui\main.cpp
    g++.exe: error: ..qt5_guimain.cpp: No such file or directory
    g++.exe: fatal error: no input files
    compilation terminated.
    Makefile.Debug:357: recipe for target 'debug/main.o' failed
    mingw32-make[1]: *** [debug/main.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/Users/Zoltan/Documents/Programming/qt5_gui-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
    makefile:34: recipe for target 'debug' failed
    mingw32-make: *** [debug] Error 2
    21:02:11: The process "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project qt5_gui (kit: Desktop Qt 5.0.1 MinGW 32bit)
    When executing step 'Make'



  • OK. It works with Win XP 32-bit also. Win 7 64-bit seems to be the problem for this 5.0.1.



  • I have found the problem!
    I installed the GIT (on Windows) before! I removed from path the GIT and the compilation is working fine!



  • Okey, but I don't have GIT installation and path does not include any GIT relations.



  • I've double checked. When I put the Git into the PATH and created a new project, I couldn't compile it. If I removed from PATH, the compilation was successful.
    I suspect that your PATH contains a program that has not compatible program with mingw or Qt 5.0. I don't know.

    I've found that sh.exe is the not compatible component in the GIT/bin folder.



  • I totally removed the path variables from user variables and system variables. After that example project started to work. Then I started to put the same values back, one by one, to the path variables to solve which one causes the problem. Now I have exactly the same contents in path variables as in start but now it seems to work with those values ?

    So removing the paths and putting them back again did the trick ? Don't know how this is possible but now it works..



  • The trick is after successful compilation the problematic and not compatible program won't be called. If you delete the build directory (debug and release) you can get the same error message. I suggest that you should find the problematic folder/program. Maybe the sh.exe in a folder.



  • Yes, I have noticed that also. New projects does not compile anymore with the existing path variables (Clean all and Rebuild all is not enough). I have to find out which path variable causes this.



  • Okey. I think I have found the problem in my workstation. I have uninstalled the OpenSSH for Windows 3.8.1p1-1 (or something). Uninstall removes also the \OpenSSH\bin variable from path. After this all the projects has been working as they should.



  • OpenSSH in my PATH was also the problem. Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.