LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 09-30-2009, 03:52 PM   #1
ESC201
Member
 
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85

Rep: Reputation: 15
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!
 
Old 09-30-2009, 04:23 PM   #2
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
Try this:

Code:
kurlrequester = new KURLRequester(centralWidget);
(capitalization)
 
Old 09-30-2009, 04:35 PM   #3
ESC201
Member
 
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by carbonfiber View Post
Try this:

Code:
kurlrequester = new KURLRequester(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.
 
Old 09-30-2009, 04:44 PM   #4
carbonfiber
Member
 
Registered: Sep 2009
Location: Sparta
Posts: 237

Rep: Reputation: 46
Mind posting ui_mainwindow.h in its entirety?
 
Old 09-30-2009, 06:28 PM   #5
ESC201
Member
 
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85

Original Poster
Rep: Reputation: 15
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
 
Old 10-04-2009, 03:33 PM   #6
ESC201
Member
 
Registered: Sep 2008
Distribution: Kubuntu 11.04
Posts: 85

Original Poster
Rep: Reputation: 15
Problem persists. Anyone?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Undefined reference, why? george_mercury Programming 4 05-07-2009 12:15 AM
undefined reference to... dimah Programming 3 12-27-2006 09:57 AM
undefined reference? Sharky01252 Programming 3 11-07-2006 11:36 AM
undefined reference vkmgeek Programming 1 05-11-2006 06:37 AM
undefined reference mp4-10 Programming 3 01-25-2005 12:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration