Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-18-2006, 12:00 AM   #1
Senior Member
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,450

Rep: Reputation: 85
compiling a simple program with qt

I followed the directions at 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
Old 01-18-2006, 02:33 AM   #2
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
that tutorial is for Qt4


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems compiling a simple shell program yekrahs Programming 3 09-26-2005 01:07 PM
Compiling a simple C++ program for Windows Baix Programming 2 03-05-2005 08:17 PM
compiling simple c/c++ program but no good freeindy Programming 3 02-12-2005 12:38 PM
Compiling a simple C++ program kbeaver Programming 27 02-06-2004 09:02 PM
Compiling a simple Mesa/GLUT program Bojdom Linux - Software 2 02-02-2003 05:19 PM

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration