[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: beginers problem : undefined reference
From: James Maes <jmaes () sportingnews ! com>
Date: 2001-08-23 17:33:23
[Download RAW message or body]
I am working though one of the online tutorials
(http://perso.wanadoo.es/antlarr/tutorial/)
And have came across this problem on example #3
The following line
KURL filename = KFileDialog::getOpenURL( QString::null, "*", this );
in the code attached below gives this error when linking
"undefined reference to 'KFileDialog::getOpenURL(QString const &, QString
const &, QWidget *, QString const &)"
Looking at the manuals and documentation I am at a lost as to why this
statement is failing. getOpenURL is a static method of KFileDialog, and all
the headers are included (AFAIK).
Any help would be great.
Thanks
#include "p3.h"
#include <kfiledialog.h> #include <kapp.h> #include <kmenubar.h> #include
<klocale.h> #include <kmessagebox.h> #include <qtextview.h>
MainWindow::MainWindow ( const char * name ) : KMainWindow ( 0L, name )
{
setCaption("KDE Tutorial - p3");
QPopupMenu *filemenu = new QPopupMenu;
filemenu->insertItem( i18n( "&Open" ), this, SLOT(fileOpen()) );
filemenu->insertItem( i18n( "&Save" ), this, SLOT(fileSave()) );
filemenu->insertItem( i18n( "&Quit" ), kapp, SLOT(quit()) );
QString about =
i18n("p3 1.0\n\n"
"(C) 1999-2001 Antonio Larrosa Jimenez\n"
"larrosa@kde.org\t\tlarrosa@suse.de\n"
"Malaga (Spain)\n\n"
"Simple KDE Tutorial\n"
"This tutorial comes with ABSOLUTELY NO WARRANTY\n"
"This is free software, and you are welcome to redistribute
it\n"
"under certain conditions\n");
QPopupMenu *helpmenu = helpMenu( about );
KMenuBar *menu = menuBar();
menu->insertItem( i18n( "&File" ), filemenu );
menu->insertSeparator();
menu->insertItem( i18n( "&Help" ), helpmenu );
QTextView *hello=new QTextView(
i18n("<H2>Hello World !</H2><BR>This is a simple"
" window with <I><font size=5><B>R<font color=red"
" size=5>ich </font><font color=blue size=5>Text"
"</font></B></I> capabilities<BR>Try to resize"
" this window, all this is automatic !"), "", this );
setCentralWidget( hello );
}
void MainWindow::fileOpen()
{
KURL filename = KFileDialog::getOpenURL( QString::null, "*", this );
QString msg = QString( i18n("Now this app should open the url %1 .")
).arg(filename.url());
KMessageBox::information( 0, msg, i18n( "Information"),
"fileOpenInformationDialog" );
}
void MainWindow::fileSave()
{
KURL filename=KFileDialog::getSaveURL( QString::null, "*", this );
}
--
------------------------------------
|| James Maes
|| Senior Programmer
|| jmaes@sportingnews.com
|| The Sporting News
|| www.sportingnews.com
|| fantasy.sportingnews.com
|| radio.sportingnews.com
------------------------------------
"given enough time and resources we can accomplish anything"
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic