Reply to topic

How to use Marble into a Qt Project

nmoreno
Registered Member
Posts
19
Karma
0

How to use Marble into a Qt Project

Tue Nov 10, 2015 1:07 pm
Hello,

Sorry in advance for this stupid question but I don't know how to use Marble Library after compile it.

I follow instruction here: https://techbase.kde.org/Projects/Marbl ... sCompiling

Now, I have Marble installed on my PC (Windows 7) and marble-qt.exe works ! So now I need to use libmarblewidget-qt5 in a Qt project. For information, I work with Qt Creator (Qt 5.5). Is there something to add to PATH? And to my PRO file?

Thank you in advance for your help.

Nicolas
nmoreno
Registered Member
Posts
19
Karma
0
Hi again,

Sorry, it's a bad question. I found the answer here: https://techbase.kde.org/Projects/Marble/MarbleWindows

But now I have another problem. When I add Marble code (like Marble::MarbleWidget) my application crash with no error or with error 255.
Can you help me, please?

There is my pro file:
Code: Select all
QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = TestMarble
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

win32 {
    INCLUDEPATH += $$quote(C:\Program Files (x86)\marble\include\marble)
    LIBS += $$quote(C:\Program Files (x86)\marble\libmarblewidget-qt5.dll)
}


Thanks in advance for your help,
Nicolas

EDIT:
By using the QtCreator debuger, the error message indicate me that a DLL is not found. I really don't understand because "libmarblewidget-qt5.dll" is add to PATH and copy next the .exe.
Have you any idea?
Thanks in advance.
nmoreno
Registered Member
Posts
19
Karma
0
Hi again,

I make questions and answers :)

For information, the documentation doesn't ask us to link with "libastro.dll" but we need to add it to make it works !

So I add this to my pro file:
Code: Select all
win32 {
    INCLUDEPATH += $$quote(C:\Program Files (x86)\marble\include\marble)
    LIBS += $$quote(C:\Program Files (x86)\marble\libmarblewidget-qt5.dll)
    LIBS += $$quote(C:\Program Files (x86)\marble\libastro.dll)
}


Have a nice day,
Nicolas
User avatar Earthwings
KDE Developer
Posts
172
Karma
1
OS
Thanks for reporting, I added that to https://techbase.kde.org/Projects/Marble/MarbleWindows

http://www.dependencywalker.com/ is handy to find missing link libraries on windows btw.
nmoreno
Registered Member
Posts
19
Karma
0
Hello Earthwings,

Sorry I don't see your answer before. Thank you for your help (here and with my others questions).

Yes I used this software before but now I use QtCreator Debugger mode. With it you can see all DLLs used by QtCreator when the application is launched (very usefull !)
larawe
Registered Member
Posts
1
Karma
0
I am trying to set up Marble to work with Qt 5.5 on OSX. I'm not very experienced with the details of linking and such and I think that is causing the problem I am having first premier credit card.
nroman
Registered Member
Posts
1
Karma
0
So a semi-solution: I used the Qt Creator "add Library" function and ended up with the following additions to the .pro file. I had to paste in the link to the lib since the dialog doesn't allow browsing of "usr/local/". Also, although I tried to link to the lib alias ("libmarblewidget-qt5.dylib"), the actual lib name is used.

Code: Select all
macx: LIBS += -L$$PWD/../../../../../usr/local/lib/ -lmarblewidget-qt5.0.21.80

INCLUDEPATH += $$PWD/../../../../../usr/local/include
DEPENDPATH += $$PWD/../../../../../usr/local/include
I don't understand what this $$PWD/../../../../../ business is.


But it worked and I am able to run the example code at the link in my question.

I wish this install/build stuff wasn't so damned arcane. I've spent endless hours just trying to get things set up – really sucks the joy out of exploring this stuff and I can't say I really learned much of anything from it. PrepaidGiftBalance

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], bgomes, Bing [Bot], boudewijn, capslock, Exabot [Bot], gfielding, Google [Bot], hhiya, Kaelygon, Kenneth Evans, Sogou [Bot], srgmro33, stefano, tymond, Yahoo [Bot]