[Marble-devel] HOWTO (in progress) - build a libmarble application on windows with Qt Creator, MinGW, CMake

Dennis Nienhüser earthwings at gentoo.org
Fri May 21 23:09:58 CEST 2010


>> But!
>>
>> The marble widget in my app is just a black rectangle where right and 
>> left clicks work as usual ( contextual menu etc)
>> Like with the standalone marble application => NO map! instead of 
>> being blue it is black...
>> I think it is normal as it does not work in marble itself.
>> So again : ANYONE having a clue??
>>
> Did you set a valid map theme on the MarbleWidget in your application?
>
Another thing: I think (correct me if I'm wrong) that in Windows plugins 
and data directories are searched relative to the application directory. 
If you use it in your own application, make sure to copy those two 
directories from the marble install over: If you have C:\MyApp\foo.exe, 
make sure to copy the data and plugins directories from the Marble 
install directory to C:\MyApp\

>> One other thing :
>> marble's widget do not show in Qt designer while the make install 
>> stage did copy
>> libMarbleWidgetPlugin.dll,  libMarbleNavigatorPlugin.dll and 
>> libLatLonEditPlugin.dll
>> in C:\Qt\2010.02.1\qt\plugins\designer.
>> (I added this path in Qtdesign even if it is a bit dumb but widgets 
>> still missing)
>> I don't know why..
>> So for the Qt creator integration it is not stil here.
>>
> The libmarblewidget.dll and any other dependent dlls must be 
> accessible for QtCreator as well. Otherwise QtCreator/QtDesigner will 
> get missing symbols when loading the designer plugin and silently 
> ignore it. When you launch marble.exe, its dependent dlls are 
> accessible for it because they lie in the same folder. That's not the 
> case for QtCreator/QtDesigner.
>

To elaborate on this as well: You need a release build of Marble 
(otherwise QtDesigner complains) and you need to copy 
libmarblewidget.dll (the release version, not the one ending with a 'd') 
to a path that QtDesigner will know. To be on the safe side, copy it 
next to designer.exe in the Qt bin folder. Also copy the data and 
plugins directories there (see above). Once that is done, QtDesigner 
will show the three Marble plugins.

If it still is not working, check the Help => Plugins dialog in 
QtDesigner. For each failing plugin, it will show an error description. 
If it complains about mixed debug and release build, correct that 
setting in CMakeCache.txt (CMAKE_BUILD_TYPE). If it complains about a 
missing module and doesn't tell you which one it misses, use  Dependency 
Walker [1]: Open the Marble designer plugin in it to see which dependent 
dlls are resolved and which not. Ignore wer.dll and ieshims.dll on 
Windows XP. Copy the ones not resolved to the Qt bin folder. That was 
only libmarblewidget.dll here. Adding the Marble directory to your PATH 
variable should work as well.

Tested this with Windows XP, MinGW 5.1.6, Qt 4.5.1 and a recent Marble 
trunk checkout.

Regards,
Dennis

[1] http://www.dependencywalker.com



More information about the Marble-devel mailing list