[Marble-devel] how to use MarbleWidget with Qt c++ on WIndows ans visual studio

M.Ozeau m.ozeau at gmail.com
Tue Aug 2 13:45:59 UTC 2011


Hi and sorry for my poor English.

I want to use the MarbleWidget on Visual C++. So i try to compile Marble
with visual Studio, but it fail (i made a post about this :
http://forum.kde.org/viewtopic.php?f=21&t=96213&sid=710f72525a7946c67f3b8c3158ef4529)
but i finally success to compile Marble with the MinGW command.

I want to do this tutorial :

http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus

I create a new project, include all the include file i found in c:\programs
files\marble\include

I include marblewidget.h and use the namespace like in the tutorial :

#include <QtGui>
#include <QtGui/qapplication.h>
#include <QtGui/qpushButton.h>

#include <marbleInclude/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();
}


But I still got some error :

error LNK2019: unresolved external symbol "__declspec(dllimport) public:
void __thiscall Marble::MarbleWidget::
setMapThemeId(class QString const &)" (__imp_?setMapThemeId at MarbleWidget
@Marble@@QAEXABVQString@@@Z) referenced in function _main

error LNK2019: unresolved external symbol "__declspec(dllimport) public:
__thiscall Marble::MarbleWidget::MarbleWidget(class QWidget *)"
(__imp_??0MarbleWidget at Marble@@QAE at PAVQWidget@@@Z) referenced in function
_main    Main.obj


I can use the MarbleWidget in QtDesigner

Any Idea ?

thx

Cordialy MoZo


-- 
Cordialement Morgan Ozeau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20110802/f7766d2e/attachment.html>


More information about the Marble-devel mailing list