LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   compiling a simple program with qt (http://www.linuxquestions.org/questions/linux-software-2/compiling-a-simple-program-with-qt-404764/)

fakie_flip 01-17-2006 11:00 PM

compiling a simple program with qt
 
I followed the directions at http://doc.trolltech.com/4.1/tutorial-t1.html to try to compile the example there called main.cpp. I have libqt3-mt. I just installed libqt2-mt-dev and all of the dependencies it needs. I do not know why I am getting these errors. What should I do?

chris@ubuntu:~/qt$ qmake -project
chris@ubuntu:~/qt$ qmake
chris@ubuntu:~/qt$ make
g++ -c -pipe -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/share/qt3/include -o main.o main.cpp
main.cpp:1:28: error: QApplication: No such file or directory
main.cpp:2:27: error: QPushButton: No such file or directory
main.cpp: In function ‘int main(int, char**)’:
main.cpp:6: error: ‘QApplication’ was not declared in this scope
main.cpp:6: error: expected `;' before ‘app’
main.cpp:8: error: ‘QPushButton’ was not declared in this scope
main.cpp:8: error: expected `;' before ‘hello’
main.cpp:9: error: ‘hello’ was not declared in this scope
main.cpp:12: error: ‘app’ was not declared in this scope
main.cpp: At global scope:
main.cpp:4: warning: unused parameter ‘argc’
main.cpp:4: warning: unused parameter ‘argv’
make: *** [main.o] Error 1
chris@ubuntu:~/qt$ ls
main.cpp Makefile qt.pro
chris@ubuntu:~/qt$

foo_bar_foo 01-18-2006 01:33 AM

that tutorial is for Qt4


All times are GMT -5. The time now is 03:36 PM.