LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-18-2008, 02:36 AM   #1
Bucephalus
LQ Newbie
 
Registered: Apr 2007
Location: Gold Coast, Australia
Distribution: Ubuntu
Posts: 5

Rep: Reputation: 0
Installing qt via synaptic on ubuntu


Hi

newbie here new to c++ and QT and linux.
I installed the following packages from synaptic, but I don't really know what I'm doing.
libqt4-core
libqt4-debug
libqt4-dev
libqt4-gui
libqt4-qt3support
libqt4-sql
libqthreads-12
qt4-designer
qt4-dev-tools
qt4-doc

I really don't know how to check if is installed correctly and operational so I just started doing the tutorial on the trolltech site here: http://doc.trolltech.com/4.4/tutorials-tutorial-t1.html

When I write this program in netbeans, the packages in the include get underlined red and they aren't found. When I try and do it in vi, and use qmake as it says down at the bottom of the page of the tutorial and I try to make the file, once again I get complaints about not being able to find these packages. Is there something that I have missed?

I have found that the include statements in the program don't have a red line under them if I do this:
#include <qt4/Qt/qapplication.h>
#include <qt4/Qt/qpushbutton.h>

instead of this
#include <QApplication.h>
#include <QPushButton.h>

I think it is something to do with the directory structure in the /usr/include directory.
as follows:

/usr/unclude/qt4/Qt
/usr/include/qt4/QtCore
/usr/include/qt4/QtGui
etc, etc,

It seems by looking at the errors from netbeans below when I compile that these directories are not being accessed. How do I fix this? Is Qt installed properly?

The red lines went, but I'm still not out of the woods. When I try and compile in netbeans, which I know the cpp compiler works in because I have tested it, the following errors are spat out.

g++ -c -g -o build/Debug/GNU-Linux-x86/main.o main.cpp
In file included from main.cpp:9:
/usr/include/qt4/Qt/qapplication.h:47:37: error: QtCore/qcoreapplication.h: No such file or directory
/usr/include/qt4/Qt/qapplication.h:48:31: error: QtGui/qwindowdefs.h: No such file or directory
/usr/include/qt4/Qt/qapplication.h:49:27: error: QtCore/qpoint.h: No such file or directory
/usr/include/qt4/Qt/qapplication.h:50:26: error: QtCore/qsize.h: No such file or directory
/usr/include/qt4/Qt/qapplication.h:51:27: error: QtGui/qcursor.h: No such file or directory
In file included from main.cpp:10:
/usr/include/qt4/Qt/qpushbutton.h:47:35: error: QtGui/qabstractbutton.h: No such file or directory
In file included from main.cpp:9:
/usr/include/qt4/Qt/qapplication.h:64: error: ‘QT_BEGIN_HEADER’ does not name a type
/usr/include/qt4/Qt/qapplication.h:84: error: function definition does not declare parameters
/usr/include/qt4/Qt/qapplication.h:363: error: ‘QT_END_HEADER’ does not name a type
In file included from main.cpp:10:
/usr/include/qt4/Qt/qpushbutton.h:57: error: function definition does not declare parameters
In file included from main.cpp:11:
/usr/include/jmorecfg.h:64: error: expected constructor, destructor, or type conversion before ‘typedef’
main.cpp: In function ‘int main(int, char**)’:
main.cpp:18: error: ‘qapplication’ was not declared in this scope
main.cpp:18: error: expected `;' before ‘app’
main.cpp:19: error: ‘qpushbutton’ was not declared in this scope
main.cpp:19: error: expected `;' before ‘hello’
main.cpp:20: error: ‘hello’ was not declared in this scope
main.cpp:21: error: ‘app’ was not declared in this scope
make[1]: *** [build/Debug/GNU-Linux-x86/main.o] Error 1
make[1]: Leaving directory `/home/bucephalus/NetBeansProjects/qt_test'
make: *** [.build-impl] Error 2

Build failed. Exit value 2.

cheers
 
Old 06-15-2008, 05:34 PM   #2
judecn
LQ Newbie
 
Registered: Jul 2007
Distribution: Debian, Angstrom, Familiar, OpenZaurus
Posts: 24

Rep: Reputation: 15
You installed the binary Qt libraries. You want the Qt development files as well if you wish to use Qt to code. The development packages should have the same (or similar) names as the ones you installed, but will end with "-dev".
 
  


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
Ubuntu 8.04 Synaptic Package Manager BACTRATE Ubuntu 6 04-26-2008 11:05 AM
Apt/Synaptic problems in Ubuntu Dougga Linux - Newbie 5 03-26-2007 08:08 AM
fedora vs. ubuntu and yum vs. synaptic conanm4 Linux - Distributions 5 08-05-2006 03:28 AM
[ubuntu linux] problem with synaptic teomatteo89 Linux - Software 16 02-04-2006 04:00 PM
Installing Ubuntu now and have some Synaptic questions. GameGuru Linux - Newbie 4 07-06-2005 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:11 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