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

Marble and Qt5

Tags: qt5, compile qt5, compile qt5, compile
(comma "," separated)
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Sat Oct 19, 2013 12:40 pm
stianb wrote:
bcooksley wrote:CMake Error at src/CMakeLists.txt:23 (STRING):
string sub-command LENGTH requires two arguments.


I had the same issue and worked around it my modifying the file ./src/CMakeLists.txt
Removing the "-qt=qt5" from line 19 did the trick.
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Mon Oct 21, 2013 11:47 am
I am running into another issue now : ./src/plugins/runner/local-osm-search fails to link.

Linking CXX shared module libLocalOsmSearchPlugind.dll
CMakeFiles\LocalOsmSearchPlugin.dir/objects.a(OsmDatabase.obj): In function `ZN6Marble11OsmDatabase4findERKNS_13DatabaseQueryE':
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:85: undefined reference to `_imp___ZN12QSqlDatabase11addDatabaseERK7QStringS2_'
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:91: undefined reference to `_imp___ZN12QSqlDatabase15setDatabaseNameERK7QString'
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:92: undefined reference to `_imp___ZN12QSqlDatabase4openEv'

Apparently QT_QTSQL_LIBRARY is not set.

I am compiling on Windows 7, with Qt 5.1.1 and cmake 2.8.12.

The command line I am using:

cmake -Wno-dev -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DQTONLY=1 -DQT5BUILD=1 -DCMAKE_INSTALL_PREFIX=../install ../sources
mingw32-make release
mingw32-make install

And the PATH is set as follows:

CMAKEDIR=/D/OpenPilotDev/cmake-2.8.12-win32-x86
QTDIR=/D/Projects/OpenPilotTools/qt-5.1.1/5.1.1/mingw48_32
MINGWDIR=/D/Projects/OpenPilotTools/qt-5.1.1/Tools/mingw48_32

export PATH=$QTDIR/bin:$MINGWDIR/bin:$CMAKEDIR/bin:/C/Windows/SysWOW64

Note: I had to add /C/Windows/SysWOW64 otherwise I had errors about missing glu32.dll.

What i then tried was to disable compilation of local-osm-search.
Compilation of marble completed but marble-qt.exe crashes immediately.

When running under gdb (in Eclipse) the only clue I get is :

947,733 20^error,msg="Error creating process D:\\Projects\\marble5\\install\\marble-qt.exe, (error 8\7)."
947,733 (gdb)
947,743 ~"Exception condition detected on fd 0\n"
947,743 ~"error detected on stdin\n"
947,743 Could not AssignProcessToObject


It now runs. I think I had several install of Qt which was causing some issue.
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Marble and Qt5

Tue Oct 22, 2013 6:18 pm
Thanks for the reports. The "-qt=qt5" call is supposed to work when qtchooser is used in place of qmake. I removed that, got the same problem.

There's a review request up for the branch now at https://git.reviewboard.kde.org/r/113392/
Would be great to get some feedback (including positive) there in order to speed up getting it into master. There's just a couple of days left until the feature freeze for the next version, so we have to hurry a bit in order to get it into the next release in time.

I'll look into the LocalOsmSearchPlugin error now (I assume it still exists?)
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Marble and Qt5

Tue Oct 22, 2013 6:27 pm
Philippe Renon wrote:I am running into another issue now : ./src/plugins/runner/local-osm-search fails to link.

Linking CXX shared module libLocalOsmSearchPlugind.dll
CMakeFiles\LocalOsmSearchPlugin.dir/objects.a(OsmDatabase.obj): In function `ZN6Marble11OsmDatabase4findERKNS_13DatabaseQueryE':
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:85: undefined reference to `_imp___ZN12QSqlDatabase11addDatabaseERK7QStringS2_'
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:91: undefined reference to `_imp___ZN12QSqlDatabase15setDatabaseNameERK7QString'
D:/Projects/marble5/sources/src/plugins/runner/local-osm-search/OsmDatabase.cpp:92: undefined reference to `_imp___ZN12QSqlDatabase4openEv'

Apparently QT_QTSQL_LIBRARY is not set.

I am compiling on Windows 7, with Qt 5.1.1 and cmake 2.8.12.

Can you please try this patch for the local-osm-search linker problem?
Code: Select all
diff --git a/src/plugins/runner/local-osm-search/CMakeLists.txt b/src/plugins/runner/local-osm-search/CMakeLists.txt
index e639f42..01f40aa 100644
--- a/src/plugins/runner/local-osm-search/CMakeLists.txt
+++ b/src/plugins/runner/local-osm-search/CMakeLists.txt
@@ -22,4 +22,4 @@ DatabaseQuery.cpp
  )
 
 marble_add_plugin( LocalOsmSearchPlugin ${localOsmSearch_SRCS} )
-target_link_libraries( LocalOsmSearchPlugin ${QT_QTSQL_LIBRARY} )
+target_link_libraries( LocalOsmSearchPlugin ${QT_QTSQL_LIBRARY} ${Qt5Sql_LIBRARIES} )
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Tue Oct 22, 2013 9:14 pm
Earthwings wrote:Can you please try this patch for the local-osm-search linker problem?


local-osm-search now links correctly !
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Tue Oct 22, 2013 9:20 pm
Earthwings wrote:There's a review request up for the branch now at https://git.reviewboard.kde.org/r/113392/


I followed the link to the review and pressed the Ship It! link.
Not sure this is the kind of feedback you are expecting. :)
I am pretty new to KDE & Marble and don't know my way around yet.
Don't hesitate to tell how to provide better feedback.

The standalone marble app seems to work fine, but I did not test it much.

I am running into some issue when integrating the Marble widget in the application I am contributing to.
Some problem when generating the tiles. I had that issue on qt4 with Marble from master branch and solved it by making sure the qt imageformats plugins were visible at runtime.
But this time, I can't seem to fix it... Still looking.

And while compiling Marble I get a lot of warnings like this:

Code: Select all
D:\Projects\marble5\sources\src\plugins\declarative\Routing.cpp:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]


Code: Select all
AUTOMOC: warning: D:/Projects/marble5/sources/src/plugins/render/speedometer/Speedometer.cpp: The file includes the moc
file "Speedometer.moc", but does not contain a Q_OBJECT macro. Running moc on "D:/Projects/marble5/sources/src/plugins/render/speedometer/Speedometer.h" ! Include "moc_Speedometer.cpp" for a compatiblity with strict mode (see CMAKE_AUTOMOC_RELAXED_MODE).


But its a minor annoyance.
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Marble and Qt5

Wed Oct 23, 2013 8:09 am
Thanks for testing, I updated the patch in the review request. According to Google the fpic warning is merely noise that can be ignored. Can you try the following patch however to see if it goes away?
Code: Select all
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95fbcdb..ba40d82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,7 +5,7 @@ project(marble)
 SET(CMAKE_COLOR_MAKEFILE ON)
 # SET(CMAKE_SKIP_RPATH ON)
 
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 
 ####################################################
 # Where to look first for cmake modules,


The automoc warning can be ignored. We're using moc like this to still support older Qt versions.

Re providing feedback, feel free to post any problems you encounter in the review request as well. Makes it easier for others to follow.
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Wed Oct 23, 2013 9:52 pm
I took the latest qt5 branch and it compiles fine and -fPIC warnings are gone :)

I'd like to have a few header files added to the "install" list defined in ./src/lib/CMakeLists.txt.
How should I proceed?
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Marble and Qt5

Sun Oct 27, 2013 7:00 pm
Which header files are you missing? Generally we try to minimize the number of installer headers, but ones that are needed for developing other applications should be installed.
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Mon Oct 28, 2013 7:39 pm
Earthwings wrote:Which header files are you missing? Generally we try to minimize the number of installer headers, but ones that are needed for developing other applications should be installed.


I need 4 additional headers:
MarbleDebug.h - to be able to turn mDebug() on and off from the application. there might be another way to get at it but did not look into it.
MarbleWidgetPopupMenu.h - to add items to the menu
PositionProviderPlugin.h - to be able write an additional position provider
PluginManager.h - to register the above plugin

All four headers have been tested in a real application. The underlying objects are properly exported and usable.

PS : those are needed in the qt5 branch...
User avatar
Earthwings
KDE Developer
Posts
172
Karma
1
OS

Re: Marble and Qt5

Wed Oct 30, 2013 6:51 pm
The qt5 branch has been merged into master now, so Qt5 support will be part of the next release (1.7, due end of the year).
The four header files you mentioned are installed now as well. There's a small API change in MarbleDebug, MarbleDebug::enable = true becomes MarbleDebug::setEnabled( true ). Enjoy :)
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Fri Nov 01, 2013 5:06 pm
Thanks Earthwings ! Great news and congrats for the qt5 merge...
wreszelewski
Registered Member
Posts
2
Karma
0

Re: Marble and Qt5

Sat Nov 23, 2013 1:34 pm
I'm happy to hear that I can use marble with Qt5.

I'm new to this topic and I'm trying to compile master branch. I use cmake command:

Code: Select all
cmake -DCMAKE_BUILD_TYPE=Debug -DQTONLY=1 -DCMAKE_INSTALL_PREFIX=/usr/local -DQT5BUILD=1 ~/marble/sources


and I get an error:

Code: Select all
CMake Error at CMakeLists.txt:70 (find_package):
  By not providing "FindQt5Script.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "Qt5Script", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5Script" with
  any of the following names:

    Qt5ScriptConfig.cmake
    qt5script-config.cmake

  Add the installation prefix of "Qt5Script" to CMAKE_PREFIX_PATH or set
  "Qt5Script_DIR" to a directory containing one of the above files.  If
  "Qt5Script" provides a separate development package or SDK, be sure it has
  been installed.


What is Qt5Script? What should I do to fix it?
Thanks in advance!
Philippe Renon
Registered Member
Posts
23
Karma
0
OS

Re: Marble and Qt5

Sat Nov 23, 2013 7:07 pm
Master MinGW build was recently broken.
Take a look here : viewtopic.php?f=217&t=118345 for a workaround.

Edit : the above applies if you are building on windows with MingW.
if not, then it looks like cmake does not find qt5.1.1
wreszelewski
Registered Member
Posts
2
Karma
0

Re: Marble and Qt5

Tue Nov 26, 2013 3:11 pm
I'm compiling it under linux. Should I somehow specify Qt5.1.1 path? How should I do it?


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]