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

Error using marble with qt5

Tags: None
(comma "," separated)
lauriane
Registered Member
Posts
6
Karma
0

Error using marble with qt5

Tue Feb 11, 2014 12:05 pm
Hi,

I downloaded marble sources from the git repository using QtCreator 5.2.1. I chose the qt5 branch.
Cmake was fine, then I encountered a problem during compilation.
This was due to redefining "pi" into the sgp4unit.h file. I corrected it, and the compilation ended without error.
Then I run mingw32-make install into the build directory, and it created the marble folder in
Code: Select all
C:\Program Files (x86)\marbleQt5

Then, I created a QtQuick application.
Here is the .pro file:
Code: Select all
   # Add more folders to ship with the application, here
   folder_01.source = qml/testmarble
   folder_01.target = qml
   DEPLOYMENTFOLDERS = folder_01

   INCLUDEPATH += $$quote(C:/Program Files (x86)/marbleQt5/include/marble)
   LIBS += $$quote(C:/Program Files (x86)/marbleQt5/libmarblewidget.dll)
   # Additional import path used to resolve QML modules in Creator's code model

   # If your application uses the Qt Mobility libraries, uncomment the following
   # lines and add the respective components to the MOBILITY variable.
   # CONFIG += mobility
   # MOBILITY +=

   # The .cpp file which was generated for your project. Feel free to hack it.
   SOURCES += main.cpp

   # Installation path
   # target.path =

   # Please do not modify the following two lines. Required for deployment.
   include(qtquick2applicationviewer/qtquick2applicationviewer.pri)
   qtcAddDeployment()

the main.cpp file:
Code: Select all
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QtQuick2ApplicationViewer viewer;
    viewer.addImportPath("C:/Program Files (x86)/marbleQt5/plugins");
    viewer.setMainQmlFile(QStringLiteral("qml/testmarble/main.qml"));
    viewer.showExpanded();

    return app.exec();
}

and the main.qml file:
Code: Select all
   import QtQuick 2.0
   import org.kde.edu.marble 0.11

   MarbleWidget {
      projection : "Spherical"
      mapThemeId : "earth/srtm/srtm.dgml"
      //workOffline: true
   }

First, the "import org.kde.edu.marble 0.11" was underlined, and the following error message was displayed:
Code: Select all
"QML module not found"

The qmldir file located into [url]C:\Program Files (x86)\marbleQt5\plugins\org\kde\edu\marble[/url] was
Code: Select all
plugin MarbleDeclarativePlugin
MarbleSettings 0.11 MarbleSettings.qml

So I changed MarbleDeclarativePlugin to libMarbleDeclarativePlugin. And when I run the application, I get the following error:
Code: Select all
file:///D:/marble/release/qml/testmarble/main.qml:2:1: plugin cannot be loaded for module "org.kde.edu.marble": The plugin 'C:/Program Files (x86)/marbleQt5/plugins/org/kde/edu/marble/libMarbleDeclarativePlugin.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)
     import org.kde.edu.marble 0.11
     ^

And in the main.qml file, "MarbleWigdet" is underlined, and the error message is to use QtQuick1 instead of QtQuick2

Maybe the reason is that marble sources for qt5 are not ready yet to be used, otherwise I must have missed something.

Thanks,

Lauriane
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS

Re: Error using marble with qt5

Tue Feb 11, 2014 2:44 pm
Hi,

The Qt5 support has been merged into master already. The Qt5 branch is discontinued. Please use Marble master instead :)

However regarding Qt Quick bindings for Marble: Those are missing from the Qt5 port.
lauriane
Registered Member
Posts
6
Karma
0

Re: Error using marble with qt5

Wed Feb 12, 2014 8:17 am
Hi,

I downloaded the main branch as you said, but I get an error while running CMake:
Code: Select all
CMake Error at src/apps/marble-ui/CMakeLists.txt:9 (QT4_ADD_RESOURCES2):
    Unknown CMake command "QT4_ADD_RESOURCES2" .

The arguments I wrote are:
Code: Select all
-DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\marbleQt5" -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE

I also tried
Code: Select all
-DCMAKE_INSTALL_PREFIX="C:\Program Files (x86)\marbleQt5" -DCMAKE_BUILD_TYPE=Release -DQTONLY=TRUE -DQT5BUILD=TRUE

but I get the same error

In this topic viewtopic.php?f=217&t=110904 they say that maybe the version of CMake is not compatible, but this post may have become obsolete.

Thanks,

Lauriane
User avatar
tackat
KDE Developer
Posts
131
Karma
0
OS

Re: Error using marble with qt5

Wed Feb 12, 2014 8:20 am
If both Qt4 and Qt5 are installed on the system, Qt4 is chosen by
default. It can be overridden using the QT5BUILD=TRUE cmake variable.
When building against Qt5, cmake will emit lots of
CMAKE_AUTOMOC_RELAXED_MODE related warnings. Please ignore them.
lauriane
Registered Member
Posts
6
Karma
0

Re: Error using marble with qt5

Wed Feb 12, 2014 10:56 am
Thanks for your reply :)
So I uninstalled Qt 4.8.5 I had on my system, and tried I again, but I still have the same error
Code: Select all
CMake Error at src/apps/marble-ui/CMakeLists.txt:9 (QT4_ADD_RESOURCES2):
    Unknown CMake command "QT4_ADD_RESOURCES2" .

Even if I have the argument:
Code: Select all
-DQT5BUILD=TRUE


Lauriane
lauriane
Registered Member
Posts
6
Karma
0

Re: Error using marble with qt5

Thu Feb 13, 2014 10:00 am
Into the files
  • "src/apps/marble-qt/CmakeLists.txt"
  • "src/apps/marble-ui/CmakeLists.txt"
I changed
Code: Select all
QT4_ADD_RESOURCES2(marble_SRCS marble.rc)

to
Code: Select all
QT5_ADD_RESOURCES(marble_SRCS marble.rc)

but the compilation ends at 59% while building qrc_marble.obj
So I completely removed those lines, and the compilation ends without error.

After that, I ran
Code: Select all
mingw32-make.exe install

But I still can't use the plugin.
in main.cpp, I have
Code: Select all
QtQuick2ApplicationViewer viewer;
viewer.addImportPath(QStringLiteral("C:/Program Files (x86)/marbleQT5/plugins"))

and in the main.qml
Code: Select all
import QtQuick 2.0
import org.kde.edu.marble 0.11

MarbleWidget{
    projection: "Spherical"
    mapThemeId: "earth/srtm/srtm.dgml"
}


"MarbleWidget" is underlined, and the message is to use QtQuick1 rather than QtQuick2, and if I launch the application, I get the error:
Code: Select all
module "org.kde.edu.marble plugin "MarbleDeclarativePlugin" not found


So in the "qmldir" file I changed
Code: Select all
plugin MarbleDeclarativePlugin
MarbleSettings 0.11 MarbleSettings.qml

to
Code: Select all
plugin libMarbleDeclarativePlugin
MarbleSettings 0.11 MarbleSettings.qml

and now the error is
Code: Select all
plugin cannot be loaded for module "org.kde.edu.marble": Cannot load library C:/Program Files (x86)/marbleQT5/plugins/org/kde/edu/marble/libMarbleDeclarativePlugin.dll: specified module could not be found


Thanks,
Lauriane
lauriane
Registered Member
Posts
6
Karma
0

Re: Error using marble with qt5

Fri Feb 21, 2014 1:36 pm
Does someone have an idea ? I'm really desperate...
Thanks
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Error using marble with qt5

Mon Feb 24, 2014 9:47 pm
Our QML support has not been ported to Qt5 yet. I'd suggest using Qt4 for the time being.
lauriane
Registered Member
Posts
6
Karma
0

Re: Error using marble with qt5

Tue Feb 25, 2014 9:34 am
OK, thanks
How long do you think it will take ?
My application is already using QtQuick 2, I'll have to wait...
Thanks again for your answer


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]