This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problem using MarbleWidget in Qt project [SOLVED]

Tags: None
(comma "," separated)
marble_developer
Registered Member
Posts
4
Karma
0
Hi all,

I have downloaded marble source code from http://edu.kde.org/marble/download.php and I unzipped in C:\marble. The MarbleWidget.h file and other include files are in this folder.

I have downloaded marble binary for MS Windows and I have installed in C:\Program Files (x86)\Marble. The marblewidget.dll is in this folder.

I'm keeping the "Hello Marble!" tutorial from http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

I have made a new project and I have add these lines in the .pro file:

Code: Select all
#-------------------------------------------------

#

# Project created by QtCreator 2012-04-21T12:38:43

#

#-------------------------------------------------

QT       += core gui

TARGET = marble

TEMPLATE = app

win32 {

    # You may need to change this include directory

    MARBLEHOME = C:/marble

    MARBLELIBHOME = "C:/Program Files (x86)/Marble"

    LIBS += -L$$MARBLELIBHOME

    INCLUDEPATH += $$MARBLEHOME/src/lib

    INCLUDEPATH += $$MARBLEHOME/src/lib/geodata

    INCLUDEPATH += $$MARBLEHOME/src/lib/geodata/data

    INCLUDEPATH += $$MARBLEHOME/src/lib/geodata/parser

}

CONFIG(debug, debug|release) {

  TARGET = $$join(TARGET,,,d)

  LIBS *= -lmarblewidget

}

CONFIG(release, debug|release) {

  LIBS *= -lmarblewidget

}

SOURCES += main.cpp\

        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui


But when I build the project I get the error:

C:\Users\User\marble\main.cpp:11: error: undefined reference to `_imp___ZN6Marble12MarbleWidgetC1EP7QWidget'
C:\Users\User\marble\main.cpp:14: error: undefined reference to `_imp___ZN6Marble12MarbleWidget13setMapThemeIdERK7QString'


What's wrong?

My main.cpp code:

Code: Select all
#include <QtGui/QApplication>

#include <MarbleWidget.h>

using namespace Marble;

int main(int argc, char *argv[])

{

    QApplication app(argc,argv);

    // Create a Marble QWidget without a parent

    MarbleWidget *mapWidget = new MarbleWidget();

    // Load the OpenStreetMap map

    mapWidget->setMapThemeId("earth/openstreetmap/openstreetmap.dgml");

    mapWidget->show();

    return app.exec();

}


I use Qt Creator (Qt 4.7.4) on Windows.

Best regards.

Last edited by marble_developer on Mon Apr 23, 2012 11:16 am, edited 1 time in total.
marble_developer
Registered Member
Posts
4
Karma
0
I use the next lines in the .pro file and the project was built with no errors:
Code: Select all
win32 {
    INCLUDEPATH += $$quote(C:/Program Files/marble/include/marble)
    LIBS += $$quote(C:/Program Files/marble/libmarblewidget.dll)
}
unix {
    LIBS += -L/usr/local/lib \
    -lmarblewidget
}


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell