LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2003, 07:55 PM   #1
vapebait
LQ Newbie
 
Registered: May 2002
Location: UK
Distribution: Gentoo
Posts: 11

Rep: Reputation: 0
Trouble compiling QT program


Hi all, I'm having trouble compiling any QT programs:

vapebait@chronos VapeCalc $ g++ -o VapeCalc main.cpp -lqt-mt
main.cpp:1:26: qapplication.h: No such file or directory
main.cpp:2:21: qwidget.h: No such file or directory
main.cpp:5: syntax error before `{' token
main.cpp:11: invalid use of undefined type `class MyMainWindow'
main.cpp:4: forward declaration of `class MyMainWindow'
main.cpp: In constructor `MyMainWindow::MyMainWindow()':
main.cpp:12: `setMinimumSize' undeclared (first use this function)
main.cpp:12: (Each undeclared identifier is reported only once for each
function it appears in.)
main.cpp:13: `setMaximumSize' undeclared (first use this function)
main.cpp: At global scope:
main.cpp:17: `main' must return `int'
main.cpp: In function `int main(...)':
main.cpp:18: `QApplication' undeclared (first use this function)
main.cpp:18: syntax error before `(' token
main.cpp:19: aggregate `MyMainWindow w' has incomplete type and cannot be
defined
main.cpp:20: `a' undeclared (first use this function)


If i use the full path in my #includes i get this:

vapebait@chronos VapeCalc $ g++ -o VapeCalc main.cpp -lqt
In file included from /usr/qt/3/include/qobjectdefs.h:42,
from /usr/qt/3/include/qwindowdefs.h:43,
from /usr/qt/3/include/qwidget.h:42,
from /usr/qt/3/include/qdesktopwidget.h:40,
from /usr/qt/3/include/qapplication.h:42,
from main.cpp:1:
/usr/qt/3/include/qglobal.h:714:21: qconfig.h: No such file or directory
/usr/qt/3/include/qglobal.h:777:23: qfeatures.h: No such file or directory
main.cpp:17: `main' must return `int'

The path to QT is /usr/qt/3/

Any help appreciated.

Thanks, Vapebait
 
Old 11-25-2003, 03:12 PM   #2
jeramy
Member
 
Registered: Nov 2003
Location: Ottawa, Canada
Distribution: Ubuntu 5.10
Posts: 46

Rep: Reputation: 15
So where is qconfig.h?

Did you install the QT header files there manually, or is that where an installer chose to put it?
 
Old 11-25-2003, 03:23 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Rather than supplying the full paths in
the source or header you should be
telling the compiler where to look :}

Code:
g++ -o VapeCalc main.cpp -lqt-mt -I/<where>/<your>/<qt-headers-are>


Cheers,
Tink
 
  


Reply


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
help compiling a program minm Linux - Newbie 3 10-10-2005 02:14 AM
trouble compiling w/c++ eroica Linux - Software 4 03-09-2005 03:17 PM
trouble compiling fretbrner Slackware 1 01-31-2005 01:30 PM
Trouble compiling anything banZera Slackware 4 04-07-2004 11:19 AM
Trouble with compiling gamehack Debian 3 01-11-2004 09:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:09 AM.

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