MantisBT - CMake
View Issue Details
0014926CMakeQtDialogpublic2014-05-22 12:332016-06-10 14:31
Milen Bilyanov 
Clinton Stimpson 
immediatefeaturealways
closedmoved 
OSXMavericks10.9.3
CMake 2.8.12.2 
 
0014926: fatal error: 'QWidget' file not found
Hi,
I am trying to compile Cmake against Qt4. The bootstrap scripts reports that QT is healthy:

"Performing C++ SOURCE FILE Test QT4_WORKS succeded with the following output"

However, later at the build stage I get the following error:
[ 89%] Building CXX object Source/QtDialog/CMakeFiles/cmake-gui.dir/AddCacheEntry.cxx.o
In file included from /me/.tmp/cmake-2.8.12.2/Source/QtDialog/AddCacheEntry.cxx:13:
/me/.tmp/cmake-2.8.12.2/Source/QtDialog/AddCacheEntry.h:16:10: fatal error: 'QWidget' file not found
#include <QWidget>
         ^
1 error generated.
make[2]: *** [Source/QtDialog/CMakeFiles/cmake-gui.dir/AddCacheEntry.cxx.o] Error 1
make[1]: *** [Source/QtDialog/CMakeFiles/cmake-gui.dir/all] Error 2
make: *** [all] Error 2

Any ideas? Thanks.

Always, just bootstrap and build.
My Qt is a custom build Qt and is in the following folder:
~/apps/Darwin64/Qt-4.8.5-gcc-4.2.1

"quake" and all the examples are working. I can say it is a healthy build.
No tags attached.
Issue History
2014-05-22 12:33Milen BilyanovNew Issue
2014-05-23 09:31Brad KingNote Added: 0035920
2014-05-26 17:14Milen BilyanovNote Added: 0035935
2014-05-26 17:15Milen BilyanovNote Edited: 0035935bug_revision_view_page.php?bugnote_id=35935#r1463
2014-05-27 08:41Brad KingAssigned To => Clinton Stimpson
2014-05-27 08:41Brad KingStatusnew => assigned
2014-05-28 09:22Clinton StimpsonNote Added: 0035953
2016-06-10 14:29Kitware RobotNote Added: 0042550
2016-06-10 14:29Kitware RobotStatusassigned => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035920)
Brad King   
2014-05-23 09:31   
Does QWidget exist in your Qt include directory? Did you build Qt with the right options to get that component?
(0035935)
Milen Bilyanov   
2014-05-26 17:14   
(edited on: 2014-05-26 17:15)
Hi Brad,

Thanks for your interest in this issue and sorry for the late reply. My Qt is compiled by me and installed in:
~/apps/Darwin64/Qt-4.8.5-gcc-4.2.1

All the tests are passed and everything works when I use the QWidget in a simple example (as such below):
#include <QApplication>
#include <QWidget>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    QWidget window;
    window.resize(250, 150);
    window.setWindowTitle("A simple example");
    window.show();

    return app.exec();
}

This compiles and builds just fine.

The problem is maybe due to the paths etc. used by the CMake installer. The breakdown of the QWidget related header files is below:

./QtGui/QWidget
./QtGui/QWidgetAction
./QtGui/QWidgetData
./QtGui/QWidgetItem
./QtGui/QWidgetItemV2
./QtGui/QWidgetList
./QtGui/QWidgetMapper
./QtGui/QWidgetSet

Maybe the installer is set to search for them in a different location?

Thanks.

(0035953)
Clinton Stimpson   
2014-05-28 09:22   
Can you also attach your CMakeCache.txt file and the output of "make VERBOSE=1"

Do you have a Qt5 on your machine? Building cmake-gui will prefer Qt5 if available.
(0042550)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.