Guten Morgen,
ich habe folgendes Problem: ich möchte mir gerade im Selbstudium die Qt-Programmierung anhand der Trolltech-Tutorials beibringen. Das Kompilieren scheitert aber schlicht und ergreifend schon im Ansatz mit Meldungen wie diesen:
Der Quelltext ist ein etwas abgespecktes erstes Trolltech-Tut, wie man sieht, und, wie man auch sieht, gibt es anscheinend schon Ärger mit den Headerdateien.
#include "/usr/X11R6/include/qapplication.h"
#include "/usr/X11R6/include/qpushbutton.h"
int main(int argc, char **argv)
{
QApplication qapp(argc, argv);
//QPushButton hallo("Hallo Welt !", 0);
//hallo.resize(100, 30);
//qapp.setMainWidget(&hallo);
//hallo.show();
return qapp.exec();
}
Fehler wie folgt:
sonnenstich ? g++ -o test test1.cpp
/var/tmp//cckNouqp.o(.text+0x11a): In function `main':
: undefined reference to `QApplication::QApplication(int&, char**)'
/var/tmp//cckNouqp.o(.text+0x129): In function `main':
: undefined reference to `QApplication::exec()'
/var/tmp//cckNouqp.o(.text+0x13a): In function `main':
: undefined reference to `QApplication::~QApplication()'
/var/tmp//cckNouqp.o(.text+0x154): In function `main':
: undefined reference to `QApplication::~QApplication()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
sonnenstich ? g++ --version
g++ (GCC) 4.2.0 20060722 (experimental)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sonnenstich ?
Naja, nun die übliche Frage: hat jemand ne Ahnung, was da schief läuft ?
ich habe folgendes Problem: ich möchte mir gerade im Selbstudium die Qt-Programmierung anhand der Trolltech-Tutorials beibringen. Das Kompilieren scheitert aber schlicht und ergreifend schon im Ansatz mit Meldungen wie diesen:
Der Quelltext ist ein etwas abgespecktes erstes Trolltech-Tut, wie man sieht, und, wie man auch sieht, gibt es anscheinend schon Ärger mit den Headerdateien.
#include "/usr/X11R6/include/qapplication.h"
#include "/usr/X11R6/include/qpushbutton.h"
int main(int argc, char **argv)
{
QApplication qapp(argc, argv);
//QPushButton hallo("Hallo Welt !", 0);
//hallo.resize(100, 30);
//qapp.setMainWidget(&hallo);
//hallo.show();
return qapp.exec();
}
Fehler wie folgt:
sonnenstich ? g++ -o test test1.cpp
/var/tmp//cckNouqp.o(.text+0x11a): In function `main':
: undefined reference to `QApplication::QApplication(int&, char**)'
/var/tmp//cckNouqp.o(.text+0x129): In function `main':
: undefined reference to `QApplication::exec()'
/var/tmp//cckNouqp.o(.text+0x13a): In function `main':
: undefined reference to `QApplication::~QApplication()'
/var/tmp//cckNouqp.o(.text+0x154): In function `main':
: undefined reference to `QApplication::~QApplication()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0xc): undefined reference to `QGList::clear()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x10): undefined reference to `QGList::~QGList()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x14): undefined reference to `QGList::~QGList()'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x18): undefined reference to `QPtrCollection::newItem(void*)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x20): undefined reference to `QGList::compareItems(void*, void*)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x24): undefined reference to `QGList::read(QDataStream&, void*&)'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTV6QGList+0x28): undefined reference to `QGList::write(QDataStream&, void*) const'
/var/tmp//cckNouqp.o(.gnu.linkonce.r._ZTI6QGList+0x8): undefined reference to `typeinfo for QPtrCollection'
collect2: ld returned 1 exit status
sonnenstich ? g++ --version
g++ (GCC) 4.2.0 20060722 (experimental)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sonnenstich ?
Naja, nun die übliche Frage: hat jemand ne Ahnung, was da schief läuft ?