Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Cannot compile code against qt4

$
0
0
Hello, I’m running ArchLinux and recently installed Qt4 and Qt5. However, the tutorial that I’m going through requires Qt4. Here is my code. #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(); } I then did the following: % qmake -project % qmake % make And this is what I got: 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 How do I point to the correct headers/libraries?

Viewing all articles
Browse latest Browse all 13965

Trending Articles