Interesting. To be clear, you made those changes to build with your
VisualStudio.NET 8.0 2005; but what's weird I was able to build that code fine
without those mods on VisualStudio.NET 7.1 2003 and Don developed the code I
believe w/ gcc on linux.
Which VS8 are you using, the free Express, the Pro? I haven't used VS8, but I
too would like to know what's going on. Glad you found success tho.
-- mew
Andrew Weitz wrote:
> To inform everyone, I finally was able to get osgEphemeris to work in my
> application. To do so, I had to make a few changes to the source. All
> the changes had to do with std::strings. I'm not exactly sure why I
> needed to make these changes, but they solved the problem. Here they
> are:
>
> 1. In EphemerisModel.cpp, I had to replace this line:
>
> _ephemerisData = new (EphemerisData::getDefaultShmemFileName())
> EphemerisData;
>
> with this line:
>
> _ephemerisData = new ("/tmp/EphemerisData.shm") EphemerisData;
>
>
> 2. In StarField.cpp, I had to comment out the definitions of
> StarField::_vertexShaderProgram and StarField::_fragmentShaderProgram.
> Then I had to put the actual string values in the calls to
> program->addShader().
>
>
> 3. In MoonModel.cpp, I had to comment out the definitions of
> MoonModel::_vertexShaderProgram and MoonModel::_fragmentShaderProgram.
> Then I had to put the actual string values in the calls to
> program->addShader().
>
>
> If anyone knows what could have caused these problems, I'd love to know.
> Thanks to everyone who offered advice!
>
> Andrew
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Weitz
> Sent: Wednesday, May 31, 2006 1:28 PM
> To: osg users
> Subject: RE: [osg-users] Error when linking to osgEphemeris.lib
>
> After looking at the call stack during the crash, the problem seems to
> be occurring here:
>
> OSG Viewer.exe!`dynamic initializer for
> 'osgEphemeris::EphemerisData::_defaultShmemFileName''() Line 16 + 0x27
> bytes C++
>
> That references the following line in EphemerisData.cpp:
>
> const std::string osgEphemeris::EphemerisData::_defaultShmemFileName =
> "/tmp/EphemerisData.shm";
>
> I tried changing the path in that line to c:\\EphemerisData.shm since I
> am using Windows, but I still got the same error. Has anyone seen this
> before?
>
> Thanks,
> Andrew
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Weitz
> Sent: Wednesday, May 31, 2006 12:37 PM
> To: osg users
> Subject: RE: [osg-users] Error when linking to osgEphemeris.lib
>
> Mike, Gordon,
>
> I was finally able to fix the linking error. I'm not exactly sure what
> caused it. Both of my projects were built with /MD. Today, I deleted
> my entire osgEphemeris directory and synched back to CVS. Then I
> rebuilt the libraries and tried linking. It worked. I definitely tried
> this yesterday with no luck. I must've been making a stupid mistake
> somewhere.
>
> Unfortunately, I now get a runtime error. I can link fine and even use
> #include <osgEphemeris/EphemerisModel>. But when I insert code to
> create the instance of the EphemerisModel
> (osg::ref_ptr<osgEphemeris::EphemerisModel> ephemerisModel = new
> osgEphemeris::EphemerisModel), I the runtime error occurs.
> Specifically, the program's crashing at
> _ASSERTE(_CrtIsValidHeapPointer(pUserData)) in dbgheap.c. This happens
> before my program even loads. In fact, I don't even get near the line
> of code that is supposed to create the EphemerisModel instance. Once
> again, I'm stuck. I appreciate your help.
>
> Andrew
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Gordon
> Tomlinson
> Sent: Wednesday, May 31, 2006 10:23 AM
> To: osg users
> Subject: RE: [osg-users] Error when linking to osgEphemeris.lib
>
>
> Looking at the error messages it look like it could be a Runtime library
> missmatch
>
> Make sure all your projects are built with Multi-threaded Debug DLL
> (/MDd)
> or Multi-threaded DLL (/MD)
>
>
> Gordon
> __________________________________________________________
> "Self defence is not a function of learning tricks
> but is a function of how quickly and intensely one
> can arouse one's instinct for survival"
> - Master Tambo Tetsura
>
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Andrew Weitz
> Sent: Wednesday, May 31, 2006 10:06 AM
> To: osg users
> Subject: RE: [osg-users] Error when linking to osgEphemeris.lib
>
>
> Mike,
>
> I synched to CVS yesterday, so I definitely have the most recent build.
> I'm using VS 2005. I can build and run EphemerisViewer.exe with no
> problems. I tried modeling my vcproj settings against those of
> EphemerisViewer, but I still get linking errors. I'm completely stuck
> here.
>
> Thanks for your help.
>
> Andrew
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mike Weiblen
> Sent: Tuesday, May 30, 2006 11:54 PM
> To: osg users
> Subject: Re: [osg-users] Error when linking to osgEphemeris.lib
>
> Also,
> are you able to build EphemerisViewer.exe without error?
> Perhaps model your build settings after vc7/Viewer/Viewer.vcproj
> instead?
>
> -- mew
>
>
> Andrew Weitz wrote:
>
>>I've been trying to solve a problem linking to osgEphemeris.lib for
>>several hours with no luck. I built the library using the default
>
> build
>
>>settings that were in
>
> osgEphemeris\VC7\osgEphemeris\osgEphemeris.vcproj.
>
>>When I try and include the library in my application (via
>>Linker->Input), I get the following errors:
>>
>>
>>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class
>>std::basic_ostream<char,struct std::char_traits<char> > & __cdecl
>>std::operator<<<char,struct std::char_traits<char>,class
>>std::allocator<char> >(class std::basic_ostream<char,struct
>>std::char_traits<char> > &,class std::basic_string<char,struct
>>std::char_traits<char>,class std::allocator<char> > const &)"
>>
>
> ([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@1@@std@@YAAAV?$basic_ostream
>
> @[EMAIL PROTECTED]@std@@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]
>
>>@@[EMAIL PROTECTED]@2@@0@@Z) already defined in
>>osgEphemeris.lib(makeMoonImages.obj)
>>
>>msvcprt.lib(MSVCP80.dll) : error LNK2005: "class
>>std::basic_string<char,struct std::char_traits<char>,class
>>std::allocator<char> > __cdecl std::operator+<char,struct
>>std::char_traits<char>,class std::allocator<char> >(class
>>std::basic_string<char,struct std::char_traits<char>,class
>>std::allocator<char> > const &,char const *)"
>>
>
> ([EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@1@@std@@YA?AV?$basic_string@
>
>>[EMAIL PROTECTED]@std@@[EMAIL PROTECTED]@2@@[EMAIL PROTECTED]@[EMAIL
>>PROTECTED]) already
>
> defined
>
>>in osgEphemeris.lib(makeMoonImages.obj)
>>
>>C:\gsti\cpp\Visualization\OSG Viewer\Release\OSG Viewer.exe : fatal
>>error LNK1169: one or more multiply defined symbols found
>>
>>
>>If I include makeMoonImages.cpp in my project, it builds fine, but I
>>crash at runtime. And it's obviously not right to include
>>makeMoonImages.cpp in my project. Has anyone seen these errors
>
> before?
>
>>I'm sorry to ask such a platform- and environment-specific question to
>>the group, but I'm completely stuck here.
>>
>>Thanks,
>>Andrew
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/