Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 11-24-2003, 06:55 PM   #1
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
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, 02:12 PM   #2
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, 02:23 PM   #3
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

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



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 01:14 AM
trouble compiling w/c++ eroica Linux - Software 4 03-09-2005 02:17 PM
trouble compiling fretbrner Slackware 1 01-31-2005 12:30 PM
Trouble compiling anything banZera Slackware 4 04-07-2004 10:19 AM
Trouble with compiling gamehack Debian 3 01-11-2004 08:35 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:02 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
Open Source Consulting | Domain Registration