[Marble-devel] Using MarbleWidget in Visual Studio on Windows

Bernhard Beschow bbeschow at cs.tu-berlin.de
Tue Aug 23 14:52:09 UTC 2011


On Dienstag, 23. August 2011 16:22:10 M.Ozeau wrote:
> Thx man,
> 
> I'm waiting for 1.2 installer and come back later if i still have some
> problems, cuz even with the 1.1 installer, i can't use MarbleWIdget in
> Visual Studio like in this tread (
> http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus). "definition of
> dllimport static data member not allowed" like in my first post.

Hmm, I now believe that we don't ship all needed files for development in the installer. IIRC, you also need the .lib files for linking and possibly the .exp(?) files for debugging symbols. So I guess you need to compile the Marble widget yourself.

You should find those files in your compilation folders and perhaps it helps to copy them to the installation folders, such that the linker can find them. Sorry that I can't help you further here since I'm not a Windows developer.

> U said i should cmake to generate my .pro file, and then use it in my VS
> project ? (Sorry i'm not sure to understand)

You need to tell cmake to generate *Visual Studio* project files (.sln or whatever the current extension is now).

Greetings,
Bernhard

> Thx a lot
> 
> Cordialy, MoZo
> 
> 2011/8/23 Bernhard Beschow <bbeschow at cs.tu-berlin.de>
> 
> > On Dienstag, 23. August 2011 14:58:19 M.Ozeau wrote:
> > > I'm sorry to spam like this but i'm still stuck....
> > >
> > >
> > > Is there any one who ever use Marble widget on windows with Visual studio
> > ??
> >
> > I haven't used Visual Studio, but I know that cmake is able to generate
> > project files for it. You could try to go this way, but you'll basically be
> > on your own.
> >
> > As I mentioned already, you could also use our Windows installer w/o the
> > need to compile the Marble widget yourself. You'd still have to set up the
> > include and library paths somewhere in your IDE, however.
> >
> > Note that for now you will only find the installer for Marble 1.1 on
> > http://edu.kde.org/marble/download.php, an installer for Marble 1.2 will
> > follow shortly (possibly today).
> >
> > HTH
> >
> > Greetings,
> > Bernhard
> >
> > > 2011/8/22 M.Ozeau <m.ozeau at gmail.com>
> > >
> > > > Any help plz ?
> > > >
> > > > 2011/8/4 M.Ozeau <m.ozeau at gmail.com>
> > > >
> > > > I finally success to compile Marble With Visual Studio 2008 and Qt
> > 4.7.3 on
> > > >> Windows. (like there
> > > >> http://techbase.kde.org/Projects/Marble/WindowsCompiling)
> > > >>
> > > >> I create a new MakeFile project in Visual Studio. Add a Main.css like
> > in
> > > >> this thread (http://techbase.kde.org/Projects/Marble/MarbleCPlusPlus)
> > > >>
> > > >> #include <QtGui/QApplication>#include <marble/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();}
> > > >>
> > > >> I copy past the marble-tmp\include\marble\ directory to my Application
> > > >> directory and the link for the #include <marble\MarbleWidget.h> is OK
> > > >>
> > > >> I copy the MarbleWidget.dll to my Debug directory and my Release
> > Directory
> > > >>
> > > >> But when i try to launch the application i still got some error :
> > > >>
> > > >> Error    2    error C2491:
> > 'Marble::AbstractDataPlugin::staticMetaObject'
> > > >> : definition of dllimport static data member not allowed
> >  c:\Documents and
> > > >> Settings\Administrateur\Mes documents\Visual Studio
> > > >> 2008\Projects\MarbleTest2\MarbleTest2\debug\moc_AbstractDataPlugin.cpp
> > > >> 48    MarbleTest2
> > > >> Error    8    error C2491:
> > > >> 'Marble::AbstractDataPluginItem::staticMetaObject' : definition of
> > dllimport
> > > >> static data member not allowed    c:\Documents and
> > > >> Settings\Administrateur\Mes documents\Visual Studio
> > > >>
> > 2008\Projects\MarbleTest2\MarbleTest2\debug\moc_AbstractDataPluginItem.cpp
> > > >> 44    MarbleTest2
> > > >> .....
> > > >> ....
> > > >> ...
> > > >> ....
> > > >> .....
> > > >> Error    252    error C2491:
> > > >> 'Marble::TileLevelRangeWidget::staticMetaObject' : definition of
> > dllimport
> > > >> static data member not allowed    c:\Documents and
> > > >> Settings\Administrateur\Mes documents\Visual Studio
> > > >>
> > 2008\Projects\MarbleTest2\MarbleTest2\debug\moc_TileLevelRangeWidget.cpp
> > > >> 51    MarbleTest2
> > > >> Error    259    error C2491:
> > 'Marble::TinyWebBrowser::staticMetaObject' :
> > > >> definition of dllimport static data member not allowed    c:\Documents
> > and
> > > >> Settings\Administrateur\Mes documents\Visual Studio
> > > >> 2008\Projects\MarbleTest2\MarbleTest2\debug\moc_TinyWebBrowser.cpp
> >  50
> > > >> MarbleTest2
> > > >> Error    264    fatal error U1077: '"C:\Program Files\Microsoft Visual
> > > >> Studio 9.0\VC\bin\cl.EXE"' : return code '0x2'    NMAKE    MarbleTest2
> > > >> Error    265    fatal error U1077: '"C:\Program Files\Microsoft Visual
> > > >> Studio 9.0\VC\bin\nmake.exe"' : return code '0x2'    NMAKE
> >  MarbleTest2
> > > >> Error    266    error PRJ0019: A tool returned an error code from
> > > >> "Performing Makefile project actions"    MarbleTest2    MarbleTest2
> > > >>
> > > >> Any help please ??
> > > >>
> > > >> Thx a lot
> > > >>
> > > >>
> > > >> --
> > > >> Cordialement Morgan Ozeau
> > > >>
> > > >>
> > > >
> > > >
> > > > --
> > > > Cordialement Morgan Ozeau
> > > >
> > > >
> > >
> > >
> > >
> >
> 
> 
> 
> 


More information about the Marble-devel mailing list