[osg-users] New way to workaround MSVC False Positives

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC Shayne.Tueller at HILL.af.mil
Thu Mar 26 09:36:45 PDT 2009


What version of Visual Studio are you using?

-Shayne

-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Can T. Oguz
Sent: Thursday, March 26, 2009 10:25 AM
To: OpenSceneGraph Users
Subject: [osg-users] New way to workaround MSVC False Positives

Hi OSG Users,

I think I've found an easier work around to overcome the MSVC false
positives. I had been using the prescription at
http://www.vis-sim.com/3dsceneBB/viewtopic.php?t=1027 to avoid the leak
false positives for my desktop application and it worked perfectly but now
I've packed the source into an MFC ActiveX and I saw that all leaks came
back. So I've removed all the additional dependencies and linked the dlls by
the directives and all the false positives are gone. I've tested the leak
detection and it worked ok.

The new workaround is :

. Goto project settings. In there, make the following changes for theDebug
build. 
. General->Use of MFC->Use Standard Windows Libraries. 
. Add _AFXDLL to C/C++->Preprocessor->Preprocessor Definitions. 
. Add the following pragma directives to stdafx.h right after the MFC
includes:

#ifdef _DEBUG
  #pragma comment(lib, "OpenThreadsd.lib")
  #pragma comment(lib, "osgd.lib")
  #pragma comment(lib, "osgDBd.lib")
  #pragma comment(lib, "osgUtild.lib")
  #pragma comment(lib, "osgGAd.lib")
  #pragma comment(lib, "osgViewerd.lib")
  #pragma comment(lib, "osgTextd.lib")
  #pragma comment(lib, "osgSimd.lib")
#else
  #pragma comment(lib, "OpenThreads.lib")
  #pragma comment(lib, "osg.lib")
  #pragma comment(lib, "osgDB.lib")
  #pragma comment(lib, "osgUtil.lib")
  #pragma comment(lib, "osgGA.lib")
  #pragma comment(lib, "osgViewer.lib")
  #pragma comment(lib, "osgText.lib")
  #pragma comment(lib, "osgSim.lib")
#endif

#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")

Regards,

Can



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6028 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090326/54f689e8/attachment-0003.bin>


More information about the osg-users mailing list