LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 06-10-2007, 10:03 AM   #1
jabka
Member
 
Registered: Sep 2005
Distribution: Debian unstable && Kazit (reformated knoppix)
Posts: 194

Rep: Reputation: 31
[QT] what package should i add to be able to compile qt stuff ?


hello,..
i would like to start learning qt so i have installed

Code:
libqt3-headers
qt3-doc
libqt3-mt-dev
im running debian etch amd64 and i would like to start learning qt programming.
my preferred IDEs is anjuta and vim.



then i went to anjuta and pasted this:
Code:
/****************************************************************
**
** Qt tutorial 1
**
****************************************************************/

#include "/usr/include/qt3/qapplication.h"
#include "/usr/include/qt3/qpushbutton.h"

int main( int argc, char **argv )
{
    QApplication a( argc, argv );

    QPushButton hello( "Hello world!", 0 );
    hello.resize( 100, 30 );

    a.setMainWidget( &hello );
    hello.show();
    return a.exec();
}
tried to compile (all went ok )..
then in make i got errors ..
so i guesed that im duing some thing worng spesific in anjuta so i went to the source dir.

Code:
qmake -project
qmake
make
but make complains about :
Code:
... ( i removed alot of them) ..
moc_qbutton.o:(.rodata._ZTV7QButton[vtable for QButton]+0x430): undefined refere                                                                                                                                 nce to `QPaintDevice::fontMet(QFont*, int, char const*, int) const'
moc_qbutton.o:(.rodata._ZTV7QButton[vtable for QButton]+0x438): undefined refere                                                                                                                                 nce to `QPaintDevice::fontInf(QFont*, int) const'
collect2: ld returned 1 exit status
make: *** [qt] Error 1
also make started with :
g++ -o qt qt_hello.o moc_qapplication.o moc_qpushbutton.o moc_qdesktopwidget.o moc_qtranslator.o moc_qwidget.o moc_qobject.o moc_qbutton.o -L/usr/X11R6/lib -lXext -lX11 -lm -lpthread

what more packages should i install to be able compile any qt stuff ?
or am i doing wrong ?

thnx in advance ..

Last edited by jabka; 06-10-2007 at 10:41 AM.
 
Old 06-10-2007, 10:14 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
This maybe a stupid question, but do you actually have the Qt library package installed? You need both the headers and the library files themselves (because those contain the compiled code of the functions and stuff).
 
Old 06-10-2007, 10:54 AM   #3
jabka
Member
 
Registered: Sep 2005
Distribution: Debian unstable && Kazit (reformated knoppix)
Posts: 194

Original Poster
Rep: Reputation: 31
this is what im not sure since in i read the package description and undertood that i should install libqt3-compat-dev but even after the installation it didn't compile

i add thous packages today.
Code:
libqt3-compat-headers
libqt3-mt-dev 
libqt3-mt
qt3-examples
qt3-qtconfig


same error ..

Last edited by jabka; 06-10-2007 at 11:01 AM.
 
Old 06-10-2007, 11:01 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
I think you also need libqt3 and libqt3-dev to be installed.
 
Old 06-10-2007, 11:07 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Minor thing: you should just be able to use "#include <header>", rather than having to put the entire path to the headers :/.
 
Old 06-10-2007, 11:09 AM   #6
jabka
Member
 
Registered: Sep 2005
Distribution: Debian unstable && Kazit (reformated knoppix)
Posts: 194

Original Poster
Rep: Reputation: 31
ok now it is going to some where ..

i have libqt3-mt and libqt3-dev but when i try check for libqt3 it says it isn't exist ..

Quote:
acerium:/home/jabka# apt-get install libqt3
Reading package lists... Done
Building dependency tree... Done
Package libqt3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libqt3-mt
 
Old 06-10-2007, 11:28 AM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I've never used apt-get, but it should have a feature to search for packages. Of course, you could just use Synaptic and search there.
 
Old 06-10-2007, 11:29 AM   #8
jabka
Member
 
Registered: Sep 2005
Distribution: Debian unstable && Kazit (reformated knoppix)
Posts: 194

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by Nylex
Minor thing: you should just be able to use "#include <header>", rather than having to put the entire path to the headers :/.
i did it sine i was not sure if anjuta (the IDE) will find them (it didn't).

now i guess that i need to send some parameter to g++ when linking

about the package search since i don't know what to search im missing something

Last edited by jabka; 06-10-2007 at 02:22 PM.
 
Old 06-12-2007, 11:56 AM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Search for packages with qt in the name and see what else is there.
 
Old 06-12-2007, 04:35 PM   #10
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
Hello,

What does your make file look like? Are you running the moc pre-compiler against your files?

I have seen these types of errors when adding new source into a project and forgetting to run the moc pre-compiler step...

Ciao!
 
  


Reply



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
Is it possible to add additional compile flag into a debian package? Akhran Debian 2 03-10-2006 04:22 PM
How and where to add stuff to auto-load .... tomazN Linux - General 4 07-10-2005 05:39 PM
add compile-time extensions to php built from a package chr15t0 Slackware 2 02-24-2005 04:17 PM
add your fun quotes and stuff Mattentaart General 16 05-05-2004 04:24 PM
how do i add stuff to the K menu ShawnD Linux - General 3 09-03-2002 11:14 PM

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

All times are GMT -5. The time now is 04:18 PM.

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