Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[OT] Fehler beim programmieren mit qt :(
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum
View previous topic :: View next topic  
Author Message
haggi-h.
n00b
n00b


Joined: 28 Jan 2004
Posts: 3

PostPosted: Wed Jan 28, 2004 2:48 pm    Post subject: [OT] Fehler beim programmieren mit qt :( Reply with quote

Hi,

Ich hab mir ein gentoo-system aufgebaut und u.a. kde und qt als USE-flag.
qt habe ich dann wie fast alles andere mit emerge installiert.
Wenn ich nun aber mit qt programmieren will erhalte ich beim Vorführprogramm des ersten Tutorials von Trolltech nen Haufen von errors.

An anderer Stelle habe ich den Hinweis gefunden, dass dies ein Versionen-Konflikt sein kann, aber ich habe halt nur das eine qt über emerge installiert. Was ist emerge-ambedded ?


Code:

/bin/sh ../libtool --silent --mode=link --tag=CXX g++ -Wnon-virtual-dtor -Wno-long-long -Wundef -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -O2 -O0 -g3 -Wall -fno-exceptions -fno-check-new -o koystem main.o
main.o(.text+0x29): In function `main':
/usr/qt/3/include/qstring.h:848: undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
main.o(.text+0x3f):/usr/qt/3/include/qstring.h:850: undefined reference to `QString::QString[in-charge](char const*)'
main.o(.text+0x67):/usr/qt/3/include/qstring.h:850: undefined reference to `QPushButton::QPushButton[in-charge](QString const&, QWidget*, char const*)'
main.o(.text+0x93): In function `main':
/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:18: undefined reference to `QPushButton::resize(int, int)'
main.o(.text+0xa8):/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:20: undefined reference to `QApplication::setMainWidget(QWidget*)'
main.o(.text+0xb6):/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:21: undefined reference to `QWidget::show()'
main.o(.text+0xc1):/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:22: undefined reference to `QApplication::exec()'
main.o(.text+0xd1):/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:22: undefined reference to `QPushButton::~QPushButton [in-charge]()'
main.o(.text+0xdc):/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:22: undefined reference to `QApplication::~QApplication [in-charge]()'
main.o(.gnu.linkonce.t._ZN7QStringD1Ev+0x1e): In function `QString::~QString [in-charge]()':
/usr/qt/3/include/qstring.h:847: undefined reference to `QString::shared_null'
main.o(.gnu.linkonce.t._ZN7QStringD1Ev+0x2d): In function `QString::~QString [in-charge]()':
/home/matthias/dateien/projects/koordinaten/koystem/koystem/main.cpp:17: undefined reference to `QStringData::deleteSelf()'
collect2: ld returned 1 exit status
gmake[2]: *** [koystem] Error 1
gmake[2]: Leaving directory `/home/matthias/dateien/projects/koordinaten/koystem/koystem'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/home/matthias/dateien/projects/koordinaten/koystem'
gmake: *** [all-recursive-am] Error 2
*** failed ***


Hier der code des Tutorials.
Code:


#include </usr/qt/3/include/qapplication.h>
#include </usr/qt/3/include/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();
}


Ich versteh auch nicht, warum ich den Pfad der libs angeben muss.


schonmal vielen Dank an alle.

Mod edit: Topic um [OT] erweitert. amne.
Back to top
View user's profile Send private message
shermann
n00b
n00b


Joined: 04 May 2003
Posts: 50
Location: Troisdorf

PostPosted: Wed Jan 28, 2004 3:56 pm    Post subject: Re: Fehler beim programmieren mit qt :( Reply with quote

haggi-h. wrote:


Hier der code des Tutorials.
Code:


#include </usr/qt/3/include/qapplication.h>
#include </usr/qt/3/include/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();
}


Ich versteh auch nicht, warum ich den Pfad der libs angeben muss.


Du musst auch nicht den Pfad angeben,
es muss heissen
Code:

#include <qapplication.h>
#include <qpushbutton.h>


Wichtig sind die Include Paths etc. die Du dem Compiler mitgibst.

Was Du jetzt noch brauchst ist eine tmake datei (siehe docu bei trolltech dazu),
oder du nimmst sofort KDevelop

Regards,

\sh
Back to top
View user's profile Send private message
Beforegod
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 1494
Location: Frankfurt/Main

PostPosted: Wed Jan 28, 2004 3:58 pm    Post subject: Reply with quote

Erstens..
dies ist kein Programmierforum.

Zweitens :

Den Pfad musst Du nicht(!!) angeben.
Wenn Du ein env-update gemacht hast, findet er die INclude Dateien von selbst (da sie im Pfad stehen).

Dein Problem scheint wirklich ein Versionskonflikt zu sein, aber probier erstmal ein env-update.
Back to top
View user's profile Send private message
shermann
n00b
n00b


Joined: 04 May 2003
Posts: 50
Location: Troisdorf

PostPosted: Wed Jan 28, 2004 4:36 pm    Post subject: Reply with quote

Beforegod wrote:
Erstens..
dies ist kein Programmierforum.


Verschieb das doch mal ins richtige forum :)

danke,
\sh
Back to top
View user's profile Send private message
haggi-h.
n00b
n00b


Joined: 28 Jan 2004
Posts: 3

PostPosted: Wed Jan 28, 2004 4:47 pm    Post subject: Reply with quote

sorry, wenn ich hier falsch bin.

ein env-update bringt keinen Erfolg... nichtmal das weglassen des Pfades funktioniert jetzt.
Back to top
View user's profile Send private message
Carlo
Developer
Developer


Joined: 12 Aug 2002
Posts: 3356

PostPosted: Wed Jan 28, 2004 7:10 pm    Post subject: Reply with quote

@Beforegod: Was soll das? Das ist ein allgemeines deutschsprachiges Forum.
"Wer_hat_ den_schönsten_Desktop_Quark" sowie einige obskure [OT] Treads passen hier rein, diese Frage aber nicht?!? So ein Unsinn! :roll:


Carlo
_________________
Please make sure that you have searched for an answer to a question after reading all the relevant docs.
Back to top
View user's profile Send private message
amne
Bodhisattva
Bodhisattva


Joined: 17 Nov 2002
Posts: 6378
Location: Graz / EU

PostPosted: Wed Jan 28, 2004 7:29 pm    Post subject: Reply with quote

Ich wage mal zu behaupten, dass man in einem Programmierforum vermutlich schneller eine bessere Antwort findet als hier. Natürlich steht es auch jedem frei, anderes zu posten. [OT] im Topic ist in solchen Fällen nicht unangebracht ;)
So, genug deeskaliert für heute und back on-(off-)topic mit dem Thread.
Back to top
View user's profile Send private message
trapperjohn
Apprentice
Apprentice


Joined: 11 Nov 2003
Posts: 242
Location: Bremen/Germany

PostPosted: Wed Jan 28, 2004 8:11 pm    Post subject: Re: Fehler beim programmieren mit qt :( Reply with quote

shermann wrote:


Was Du jetzt noch brauchst ist eine tmake datei (siehe docu bei trolltech dazu),
oder du nimmst sofort KDevelop



Am einfachsten ist 'qmake' - ist glaub ich seit Qt 3.0 mit dabei. Erstellt dir ganz simpel deine Makefiles und hilft ungemein (vor allem Anfängern) beim Übersetzen von Qt-Anwendungen.

Ich weiss nicht mehr aus dem Kopf, wie das aufzurufen ist - war aber sehr einfach und auch sehr verständlich.
Back to top
View user's profile Send private message
haggi-h.
n00b
n00b


Joined: 28 Jan 2004
Posts: 3

PostPosted: Thu Jan 29, 2004 10:57 am    Post subject: Reply with quote

Ich habe doch wie oben beschrieben KDevelop und ich hab irgend nen qt bei 3.2.x . Entweder spinnen die Tutorials oder etwas stimmt noch nicht bei meiner Installation und das probiere ich rauszubekommen.
Back to top
View user's profile Send private message
dalu
Guru
Guru


Joined: 20 Jan 2003
Posts: 529

PostPosted: Thu Jan 29, 2004 12:11 pm    Post subject: Reply with quote

hi haggi

mach mal

env | grep Q
um zu sehn ob QTDIR und QMAKESPEC gesetzt sind

und poste mal dein Makefile

hast du mit kdevelop ein C++/qmake project/hello world program
gemacht? oder was hast du gemacht?

wenn du ein stinknormales c++ projekt erstellt hast, dann must du
-lqt-mt (das ist ein L kein I , ich nehm an portage hat das multithreaded compiliert) bei LIBS in deinem Makefile hinzufügen
außerdem must dann noch den includepfad zu den headern setzen
-I/usr/lib/qt z.B. oder woauchimmer deine header sind
qt-embedded ist für pdas

btw wenn du den absoluten ort der qt header schon angeben must dann mach das in "" nicht in <>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Diskussionsforum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum