Ich möchte gerne ein paar kleine qt3 / kde - programme entwickeln. Das Klassische Hello World habe ich bereits kompiliert und gestarted.
Nun wollte ich das ganze mal mit einem Programm aus einem bekannten Lehrbuch (KHelloWorld) machen.
Code: Alles auswählen
#include <kaction.h>
#include <kapp.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kmainwindow.h>
#include <kmenubar.h>
#include <kstdaction.h>
#include <qlabel.h>
#include <qpopupmenu.h>
int main (int argc, char **argv)
{
QString aboutText ("KDE- und Qt-Programmierung\n"
"(c) 2000 Addison-Wesley-Germany");
KApplication app;
KMainWindow *top = new KMainWindow ();
QPopupMenu *filePopup = new QPopupMenu (top);
top->menuBar()->insertItem (i18n ("&File"), filePopup);
top->menuBar()->insertSeparator();
QLabel *text = new QLabel (i18n ("<H1>Hello, World!</H1>"), top);
top->setCentralWidget (text);
top->show();
return app.exec();
}
also ein einfaches Programm, aber wenn ich es versuche mit:
gcc khelloworld.cpp -o khelloword -I /usr/include/kde -I /usr/include/qt -Lkdeui -lkdecore -lqt
zu komplieren, dann bekomme ich ellenlage fehlermeldungen.
Wie kann das kommen? Ich meine ich habe alle notwendigen Packete installiert oder fehlen noch welche?
Gruß Nixdorf
HIer nochmal die Felermeldungen:
von khelloworld.cpp:7:
/usr/include/kde/kactionclasses.h:32:26: qkeysequence.h: Datei oder Verzeichnis nicht gefunden
/usr/include/kde/kactionclasses.h:33:21: qobject.h: Datei oder Verzeichnis nicht gefunden
/usr/include/kde/kactionclasses.h:34:24: qvaluelist.h: Datei oder Verzeichnis nicht gefunden
/usr/include/kde/kactionclasses.h:35:25: qguardedptr.h: Datei oder Verzeichnis nicht gefunden
In file included from /usr/include/kde/kaction.h:624,
from khelloworld.cpp:7:
/usr/include/kde/kactionclasses.h: At global scope:
/usr/include/kde/kactionclasses.h:70: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:185: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:197: error: Syntaxfehler before `:' token
/usr/include/kde/kactionclasses.h:68: Warnung: `class KToggleAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:214: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:313: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:423: error: ISO C++ forbids declaration of `
QStringList' with no type
/usr/include/kde/kactionclasses.h:423: error: `QStringList' declared as a
`virtual' field
/usr/include/kde/kactionclasses.h:423: error: Fehler beim Parsen before `('
token
/usr/include/kde/kactionclasses.h:470: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:482: error: Fehler beim Parsen before `&'
token
/usr/include/kde/kactionclasses.h:511: error: Fehler beim Parsen before `)'
token
/usr/include/kde/kactionclasses.h:518: error: Syntaxfehler before `:' token
/usr/include/kde/kactionclasses.h:311: Warnung: `class KSelectAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:555: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:642: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:553: Warnung: `class KListAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:669: error: `uint' was not declared in this
scope
/usr/include/kde/kactionclasses.h:669: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:695: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:695: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:707: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:707: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:719: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:719: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:735: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:735: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:751: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:751: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:759: error: type specifier omitted for
parameter `uint'
/usr/include/kde/kactionclasses.h:759: error: Fehler beim Parsen before `='
token
/usr/include/kde/kactionclasses.h:771: error: Fehler beim Parsen before `)'
token
/usr/include/kde/kactionclasses.h:821: error: Syntaxfehler before `:' token
/usr/include/kde/kactionclasses.h:667: Warnung: `class KRecentFilesAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:800: error: incomplete type `QString' does
not have member `null'
/usr/include/kde/kactionclasses.h:791: error: incomplete type `QString' does
not have member `null'
/usr/include/kde/kactionclasses.h:852: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:879: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:850: Warnung: `class KFontAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h: In member function `QString
KFontAction::font() const':
/usr/include/kde/kactionclasses.h:873: error: return type `struct QString' is
incomplete
/usr/include/kde/kactionclasses.h:433: error: `virtual QString
KSelectAction::currentText() const' is private
/usr/include/kde/kactionclasses.h:874: error: within this context
/usr/include/kde/kactionclasses.h:874: error: invalid use of undefined type `
struct QString'
/usr/include/kde/kglobal.h:33: error: forward declaration of `struct QString'
/usr/include/kde/kactionclasses.h: At global scope:
/usr/include/kde/kactionclasses.h:892: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:914: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:922: error: Syntaxfehler before `:' token
/usr/include/kde/kactionclasses.h:890: Warnung: `class KFontSizeAction' only
defines a private destructor and has no friends
/usr/include/kde/kaction.h: In member function `virtual void
KFontSizeAction::slotActivated()':
/usr/include/kde/kaction.h:547: error: `virtual void KAction::slotActivated()'
is private
/usr/include/kde/kactionclasses.h:920: error: within this context
/usr/include/kde/kactionclasses.h: At global scope:
/usr/include/kde/kactionclasses.h:950: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:948: Warnung: `class KActionMenu' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:1023: error: Fehler beim Parsen before `READ'
/usr/include/kde/kactionclasses.h:1021: Warnung: `class KToolBarPopupAction'
only defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:1145: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:1162: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:1166: error: 'QCString' is used as a type,
but is not defined as a type.
/usr/include/kde/kactionclasses.h:1167: error: 'QGuardedPtr' is used as a type,
but is not defined as a type.
/usr/include/kde/kactionclasses.h:1143: Warnung: `class KToggleToolBarAction'
only defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h: In member function `KToolBar*
KToggleToolBarAction::toolBar()':
/usr/include/kde/kactionclasses.h:1160: error: `m_toolBar' undeclared (first
use this function)
/usr/include/kde/kactionclasses.h: At global scope:
/usr/include/kde/kactionclasses.h:1190: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:1210: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:1216: error: type specifier omitted for
parameter `QEvent'
/usr/include/kde/kactionclasses.h:1216: error: Fehler beim Parsen before `*'
token
/usr/include/kde/kactionclasses.h:1188: Warnung: `class KToggleFullScreenAction
' only defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:1234: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:1263: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:1266: error: 'QGuardedPtr' is used as a type,
but is not defined as a type.
/usr/include/kde/kactionclasses.h:1232: Warnung: `class KWidgetAction' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h: In member function `QWidget*
KWidgetAction::widget()':
/usr/include/kde/kactionclasses.h:1249: error: `m_widget' undeclared (first use
this function)
/usr/include/kde/kactionclasses.h: At global scope:
/usr/include/kde/kactionclasses.h:1278: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:1276: Warnung: `class KActionSeparator' only
defines a private destructor and has no friends
/usr/include/kde/kactionclasses.h:1304: error: Syntaxfehler before `public'
/usr/include/kde/kactionclasses.h:1340: error: Fehler beim Parsen before `:'
token
/usr/include/kde/kactionclasses.h:1302: Warnung: `class KPasteTextAction' only
defines a private destructor and has no friends
In Datei, eingefügt von /usr/include/kde/kapp.h:5,
von khelloworld.cpp:8:
/usr/include/kde/kapplication.h:40:26: qapplication.h: Datei oder Verzeichnis nicht gefunden
/usr/include/kde/kapplication.h:41:21: qpixmap.h: Datei oder Verzeichnis nicht gefunden
In file included from /usr/include/kde/kapp.h:5,
from khelloworld.cpp:8:
usw...