This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 191690 - Broken Qt support
Summary: Broken Qt support
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.0
Hardware: PC Other
: P2 normal (vote)
Assignee: Andrew Krasny
URL:
Keywords:
Depends on:
Blocks: 185806
  Show dependency tree
 
Reported: 2010-11-06 00:36 UTC by simpatico
Modified: 2010-12-09 20:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description simpatico 2010-11-06 00:36:31 UTC
Try creating a new Qt project through the IDE, and the run it. This is what I get:

"/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/2010.05/qt/qmake/qmake.exe SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/kahloutg/Documents/NetBeansProjects/QtApplication_1'
/C/Qt/2010.05/qt/qmake/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/bin/make" -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/QtApplication_1.exe
make[2]: Entering directory `/c/Users/kahloutg/Documents/NetBeansProjects/QtApplication_1'
g++.exe -c -g -Wall -fno-exceptions -fno-rtti -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -DQT_NO_DYNAMIC_CAST -I'c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/include/QtCore' -I'c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/include/QtGui' -I'c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/include' -I'c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/include/ActiveQt' -I'.' -I'nbproject' -I'.' -I'c:/Qt/2010.05/qt/mkspecs/win32-g++' -o build/Debug/MinGW-Windows/main.o main.cpp
main.cpp:8:30: error: QtGui/QApplication: No such file or directory
main.cpp: In function 'int main(int, char**)':
main.cpp:14: error: 'QApplication' was not declared in this scope
main.cpp:14: error: expected ';' before 'app'
main.cpp:18: error: 'app' was not declared in this scope
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make[2]: Leaving directory `/c/Users/kahloutg/Documents/NetBeansProjects/QtApplication_1'
make[1]: Leaving directory `/c/Users/kahloutg/Documents/NetBeansProjects/QtApplication_1'
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

I've Qt projects working in Qt Creator.

Likewise try the sample qt project:

"/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/2010.05/qt/qmake/qmake.exe SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/kahloutg/Documents/NetBeansProjects/HelloQtWorld_2'
/C/Qt/2010.05/qt/qmake/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/bin/make" -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/HelloQtWorld_2.exe
make[2]: c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/binuic.exe: Command not found
make[2]: *** [ui_HelloForm.h] Error 127
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Entering directory `/c/Users/kahloutg/Documents/NetBeansProjects/HelloQtWorld_2'
c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/binuic.exe HelloForm.ui -o ui_HelloForm.h
make[2]: Leaving directory `/c/Users/kahloutg/Documents/NetBeansProjects/HelloQtWorld_2'
make[1]: Leaving directory `/c/Users/kahloutg/Documents/NetBeansProjects/HelloQtWorld_2'

BUILD FAILED (exit value 2, total time: 874ms)

Qt is at 4.7 now, and the path for binuic.exe is totally made up.
Comment 2 Leonid Lenyashin 2010-11-06 20:05:15 UTC
There is no practical way of fixing Qt bugs...
Comment 3 simpatico 2010-11-06 20:09:21 UTC
what do you mean? This used to work.
Comment 4 Vladimir Voskresensky 2010-11-07 08:50:54 UTC
(In reply to comment #3)
> what do you mean? This used to work.
It means that bug is in new Qt and issue #185806 contains sample project you can give to Qt developers to easier fix Qt

Or do you want to say that you didn't upgrade your Qt version and it stopped to work?

*** This bug has been marked as a duplicate of bug 185806 ***
Comment 5 simpatico 2010-11-07 09:42:11 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > what do you mean? This used to work.
> It means that bug is in new Qt and issue #185806 contains sample project you
> can give to Qt developers to easier fix Qt
> 
> Or do you want to say that you didn't upgrade your Qt version and it stopped to
> work?
> 
> *** This bug has been marked as a duplicate of bug 185806 ***

If you notice I mentioned two problems (the whole of Qt support). The create new project doesn't use binuic.exe at all, and yet it doesn't work. Where do these paths come from?

-I'c:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/include/QtCore'

I'm on a new windows machine that didn't have QT installed before.
Comment 6 soldatov 2010-11-07 10:41:15 UTC
What return "qmake -v" command in any Windows console?

And also:
http://www.qtcentre.org/threads/34865-Error-quot-QT-version-is-not-properly-installed-please-run-make-install-quot-on-Windows-XP
Comment 7 Leonid Lenyashin 2010-11-08 09:58:11 UTC
So far I see no evidence it is a P1 (no regression reported, it is seen in a new environment) as well as no evidence there is a bug at all. Let keep it incomplete until we have more information form a user.
Comment 8 soldatov 2010-11-08 17:36:13 UTC
First problem appears if user selected C:/Qt/2010.05/qt/qmake/qmake.exe instead of C/Qt/2010.05/qt/bin/qmake.exe
In this case:
F:\Qt\2010.05\qt\qmake>qmake.exe -v
QMake version 2.01a
Using Qt version 4.7.0 in C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more/Troll/4.6/qt/lib

In order to fix you needs to change "C/C++|Build Tools|QMake Command" text field on "C/Qt/2010.05/qt/bin/qmake.exe"
Comment 9 Andrew Krasny 2010-12-09 18:51:15 UTC
Bug confirmed. 
Indeed qmake generates broken files (no slash after bin), but this is because NB doesn't specify -spec flag.

The work-around, though, is to specify -spec in project's properties (Build->Qt->Expert->QMake spec) and set it to 'win32-g++' on Windows.
Comment 10 Andrew Krasny 2010-12-09 18:54:34 UTC
fixed in cnd-main: http://hg.netbeans.org/cnd-main/rev/93bc0840ed84

Valera, could you, please, ensure that fix works with 'old' qt and on platforms other than Windows are not affected.
Comment 11 Andrew Krasny 2010-12-09 20:30:49 UTC
Turned out that 

"The work-around, though, is to specify -spec in project's properties
(Build->Qt->Expert->QMake spec) and set it to 'win32-g++' on Windows."

is not 100% true.

It works if project is created INSIDE QT tree ONLY ({QT_INSTALL_DIR}/qt... )

So... add fix: http://hg.netbeans.org/cnd-main/rev/ce941ae97c5d