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
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
09-30-2009, 03:52 PM
#1
Member
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85
Rep:
QT: Undefined Reference to KUrlRequester
Hi all, I am new to the Linux programming world. I am trying to make a simple application in QT Creator with QT 4.5.2 and I am recieveing the error...
Code:
/path/to/file/ui_mainwindow.h:81: undefined reference to `KUrlRequester::KUrlRequester(QWidget*)'
...when trying to compile the program.
The line the error is on (81) is...
Code:
kurlrequester = new KUrlRequester(centralWidget);
I don't know what other info is relevant, so here's some info about my environment. I'm running 64bit Fedora 11 with Gnome 2.26.3. I've installed all the KDE devel packages I can find in the repos.
Any help or a point in the right direction would be awesome. Thank you!
09-30-2009, 04:23 PM
#2
Member
Registered: Sep 2009
Location: Sparta
Posts: 237
Rep:
Try this:
Code:
kurlrequester = new KURL Requester(centralWidget);
(capitalization)
09-30-2009, 04:35 PM
#3
Member
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85
Original Poster
Rep:
Quote:
Originally Posted by
carbonfiber
Try this:
Code:
kurlrequester = new KURL Requester(centralWidget);
(capitalization)
Thank you for your reply. I now receive...
Code:
/path/to/file/ui_mainwindow.h:81: error: expected type-specifier before ‘KURLRequester’
/path/to/file/ui_mainwindow.h:81: error: cannot convert ‘int*’ to ‘KUrlRequester*’ in assignment
/path/to/file/ui_mainwindow.h:81: error: expected ‘;’ before ‘KURLRequester’
I assume the latter errors are a result of the first error; no harm in posting them however.
09-30-2009, 04:44 PM
#4
Member
Registered: Sep 2009
Location: Sparta
Posts: 237
Rep:
Mind posting ui_mainwindow.h in its entirety?
09-30-2009, 06:28 PM
#5
Member
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85
Original Poster
Rep:
Sure, mind you all this code was generated by Qt Creator.
Code:
/********************************************************************************
** Form generated from reading ui file 'mainwindow.ui'
**
** Created: Mon Sep 28 20:32:51 2009
** by: Qt User Interface Compiler version 4.5.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QFrame>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QListView>
#include <QtGui/QMainWindow>
#include <QtGui/QMenuBar>
#include <QtGui/QProgressBar>
#include <QtGui/QPushButton>
#include <QtGui/QStatusBar>
#include <QtGui/QToolBar>
#include <QtGui/QWidget>
#include <kurlrequester.h>
#include "kurl.h"
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QWidget *centralWidget;
QPushButton *pushButton_2;
QLabel *label;
QLabel *label_4;
QListView *listView;
QPushButton *pushButton;
KUrlRequester *kurlrequester;
QFrame *line;
QLabel *label_2;
KUrlRequester *kurlrequester_2;
QLabel *label_3;
QProgressBar *progressBar;
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QString::fromUtf8("MainWindow"));
MainWindow->resize(600, 294);
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
pushButton_2 = new QPushButton(centralWidget);
pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));
pushButton_2->setGeometry(QRect(440, 120, 101, 31));
label = new QLabel(centralWidget);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(90, 20, 91, 16));
QFont font;
font.setPointSize(12);
font.setBold(true);
font.setWeight(75);
label->setFont(font);
label_4 = new QLabel(centralWidget);
label_4->setObjectName(QString::fromUtf8("label_4"));
label_4->setGeometry(QRect(450, 190, 101, 21));
label_4->setLayoutDirection(Qt::RightToLeft);
listView = new QListView(centralWidget);
listView->setObjectName(QString::fromUtf8("listView"));
listView->setGeometry(QRect(10, 90, 256, 131));
pushButton = new QPushButton(centralWidget);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(QRect(310, 120, 101, 31));
kurlrequester = new KUrlRequester(centralWidget);
kurlrequester->setObjectName(QString::fromUtf8("kurlrequester"));
kurlrequester->setGeometry(QRect(10, 40, 251, 41));
line = new QFrame(centralWidget);
line->setObjectName(QString::fromUtf8("line"));
line->setGeometry(QRect(273, 30, 20, 191));
line->setFrameShape(QFrame::VLine);
line->setFrameShadow(QFrame::Sunken);
label_2 = new QLabel(centralWidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(350, 20, 161, 21));
label_2->setFont(font);
kurlrequester_2 = new KUrlRequester(centralWidget);
kurlrequester_2->setObjectName(QString::fromUtf8("kurlrequester_2"));
kurlrequester_2->setGeometry(QRect(300, 50, 251, 22));
label_3 = new QLabel(centralWidget);
label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setGeometry(QRect(340, 80, 171, 16));
progressBar = new QProgressBar(centralWidget);
progressBar->setObjectName(QString::fromUtf8("progressBar"));
progressBar->setGeometry(QRect(310, 190, 151, 23));
progressBar->setValue(42);
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QString::fromUtf8("menuBar"));
menuBar->setGeometry(QRect(0, 0, 600, 26));
MainWindow->setMenuBar(menuBar);
mainToolBar = new QToolBar(MainWindow);
mainToolBar->setObjectName(QString::fromUtf8("mainToolBar"));
MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar);
statusBar = new QStatusBar(MainWindow);
statusBar->setObjectName(QString::fromUtf8("statusBar"));
MainWindow->setStatusBar(statusBar);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "MainWindow", 0, QApplication::UnicodeUTF8));
pushButton_2->setText(QApplication::translate("MainWindow", "Clear List", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("MainWindow", "Input Files", 0, QApplication::UnicodeUTF8));
label_4->setText(QApplication::translate("MainWindow", "Waiting...", 0, QApplication::UnicodeUTF8));
pushButton->setText(QApplication::translate("MainWindow", "Convert!", 0, QApplication::UnicodeUTF8));
kurlrequester->setText(QApplication::translate("MainWindow", "hi", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("MainWindow", "Output Directory", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("MainWindow", "(will be created if not exist)", 0, QApplication::UnicodeUTF8));
Q_UNUSED(MainWindow);
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
10-04-2009, 03:33 PM
#6
Member
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85
Original Poster
Rep:
Problem persists. Anyone?
All times are GMT -5. The time now is 06:02 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News