[osg-users] Crash on first example - push_back call

Posch, Stephan sposch at camber.com
Sun Jun 1 10:31:48 PDT 2008


Hey Adrian,

>The tutorial should work. I just tested it by compiling it with Visual
>Studio 8 and osg 2.4. I can tell from the error you get that you are
>generating a debug build in Visual Studio. Are you sure that you also
>link against the debug version of osg (osgd.lib, osgDBd.lib and so
>on)?
>What version are you running?

>/Jakob Ruhe

Jakob makes a good point.  Linking against the debug versions becomes extremely important when using VC8 & VC9 due to the introduction of iterator debugging.  Iterator debugging is defaulted "on" in debug mode, and defaulted "off" in release mode.  If you run debug mode in your app and link with the release mode of the osg libs, you basically end up with a violation of the One Definition Rule.  You'll have two definitions of a bunch of STL functions:  one with _HAS_ITERATOR_DEBUGGING defined and one with _HAS_ITERATOR_DEBUGGING undefined.  What you'll end up seeing is a random crash on some STL function that makes no since...

Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3128 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080601/f9bf0534/attachment.bin>


More information about the osg-users mailing list