You are not logged in.
This is the code that I have:
#include <QApplication>
#include <QWidget>
int main(int argc, char * argv[])
{
QApplication app(argc, argv);
QWidget window;
window.resize(250, 150);
window.setWindowTitle("Simple example");
window.show();
return app.exec();
}
This is the error that I get:
g++ -c -pipe -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -I. -I/usr/include/qt -I/usr/include/qt/QtGui -I/usr/include/qt/QtCore -I. -o hello_world.o hello_world.cpp
hello_world.cpp:3:24: fatal error: QApplication: No such file or directory
#include <QApplication>
^
compilation terminated.
Makefile:298: recipe for target 'hello_world.o' failed
make: *** [hello_world.o] Error 1
These are the other threads that I researched.
https://bbs.archlinux.org/viewtopic.php?id=66927
https://bbs.archlinux.org/viewtopic.php?id=37815
When I did a search for "qt4" in "/", this is what I got:
./usr/include/qt4
./usr/share/qt4
./usr/share/licenses/qt4
./usr/lib/qt4
Now, why are these headers not detected?
Last edited by publicus (2014-01-03 18:21:27)
Offline
Your g++ -I include paths point to Qt5.
Offline
Your g++ -I include paths point to Qt5.
How do I set it to Qt4?
Offline
I got it! I used the tool qtchooser to run qmake so that when the Makefile is generated, it's generated with Qt4 in mind. The process was something like this:
qmake -project && qtchooser -run-tool=qmake -qt=4 && make
Offline
There is also qmake-qt4
Offline
There is also qmake-qt4
And I learned something new .
Offline