OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Windows and weird error messages


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> VirtualPlanetBuilder [vpb]
View previous topic :: View next topic  
Author Message
UmberGryphon (Keith Steiger)
Newbie


Joined: 11 Oct 2013
Posts: 3

PostPosted: Wed Apr 09, 2014 11:27 am    Post subject:
Windows and weird error messages
Reply with quote

I needed to get VPB working on Windows (Visual Studio 2010), and I ran into a bizarre compiler error that I'm sure you've heard about before:

std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in SpatialProperties.obj

I found, surprisingly enough, that giving vpb::LogFile an empty destructor made the error go away. Would it be possible to add an empty destructor to the master copy of the source code? I can't see how it would hurt other OSes....

Keith Steiger
(who doesn't know how Subversion does the equivalent of a pull request)

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56783#56783







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message Send e-mail
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10983

PostPosted: Fri Apr 11, 2014 2:39 pm    Post subject:
Windows and weird error messages
Reply with quote

Hi Keith,

We've had problems with VisualStudio's buggy compiler when it comes to
handling valid C++ relating to streams. It's kinda crap but that's
just what we have to put with.

Is the problem you are having with the svn/trunk version of VPB or one
of the dev releases? There is chance that svn/trunk already has a fix
checked in.

Could you post the exact compiler error?

For fixes just subscribed to osg-submissions and post the whole
modified file. I can then pick the file from there and do a review of
the changes.

Cheers
Robert.

On 14 October 2013 22:50, Keith Steiger <> wrote:
Quote:
I needed to get VPB working on Windows (Visual Studio 2010), and I ran into a bizarre compiler error that I'm sure you've heard about before:

std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in SpatialProperties.obj

I found, surprisingly enough, that giving vpb::LogFile an empty destructor made the error go away. Would it be possible to add an empty destructor to the master copy of the source code? I can't see how it would hurt other OSes....

Keith Steiger
(who doesn't know how Subversion does the equivalent of a pull request)

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56783#56783








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 764

PostPosted: Fri Apr 11, 2014 3:03 pm    Post subject:
Windows and weird error messages
Reply with quote

Hi Keith,

Please search the forum/mailing list.
This topic has been raised quite a few times.

Please add /FORCE:Multiple to your linker options for the complaining
module/linking application.

@Robert, I think the option might be added to the CMakeList to fix this
at least for VPB.




Quote:
I needed to get VPB working on Windows (Visual Studio 2010), and I ran into a bizarre compiler error that I'm sure you've heard about before:

std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in SpatialProperties.obj

I found, surprisingly enough, that giving vpb::LogFile an empty destructor made the error go away. Would it be possible to add an empty destructor to the master copy of the source code? I can't see how it would hurt other OSes....

Keith Steiger
(who doesn't know how Subversion does the equivalent of a pull request)

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56783#56783









------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
dglenn (David Glenn)
Appreciator


Joined: 07 Jan 2009
Posts: 205
Location: Burbank, Calif. U.S.A.

PostPosted: Thu Apr 17, 2014 10:46 pm    Post subject:
Reply with quote

Greetings All!

I just went through the same thing! It would be good to make note of it some ware in a readme about it! I had to search though the forum to figure it out and I'm not sure I like the fix, but I can't find any better idea to work around it, but it works.

The only other advice I have is to make sure you preinstall G-Dal and test it before you compile Open Scene Graph and VPB to them. I used G-Dal 1.10.1 that has installs and prebuilt lib’s and include that worked well for me.

I used Visual Studio 2010 Professional with Service Pack 1 added.

The only other suggestion I have is to add a command line shell that you can use to run VPB properly. I hacked mine using the shell that I found on the G-Dal core install and modified it so it can see all the g-dal stuff.

I learned by poking around with Q-GIS that the best way to do OSG anything in Windows is to have all the lib and executables in a single directory and use it from there.

I moved all the binary’s to a single directory starting with the OSG binary stuff I compiled plus the plug-ins and adding the VPB stuff on top of that! I make sure that I added that to my path environmental variable.

I open up the vpb command line shell, cd to the directory that I what to build my stuff and let her rip! No complaints yet!!

_________________
David Glenn
---------------
D Glenn 3D Computer Graphics Entertainment.
www.dglenn.com
Back to top
View user's profile Send private message Visit poster's website
bbjorn
Appreciator


Joined: 12 Oct 2010
Posts: 186
Location: Linköping, Sweden

PostPosted: Fri May 16, 2014 10:01 am    Post subject:
Reply with quote

Hi,

I fixed this by replacing all std::ifstream with osgDB::ifstream.
And all std::ofstream with osgDB::ofstream.

And then you will have to replace the following line in include/vpb/BuildLog:
Code:
#include <fstream>


with:
Code:
#include <osgDB/fstream>



Maybe this should be submitted as a permanent fix?

/Björn
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> VirtualPlanetBuilder [vpb] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts PHPBB ERROR: A Closer Look, and Why Steal General 0 Mon Jul 10, 2017 11:03 am View latest post
No new posts PBuffer causing error when profiling ... jsmitq General 1 Thu Jun 08, 2017 4:24 pm View latest post
No new posts Error with InputStream reading osgb f... Riccardo Corsi General 28 Thu Jun 08, 2017 11:20 am View latest post
No new posts MFC mdi child windows show the scene ... rposg General 1 Fri May 26, 2017 6:37 pm View latest post
No new posts OpenGL error when using TextureBuffer MariusD General 1 Mon May 22, 2017 1:40 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP