|
在网上搜了一下,说是osgd.dll后于mfcXXd.dll释放,导致mfc误认为osg中全局变量没有释放,并给出了解决办法:
i) in the General tab, switch "Use MFC in a shared DLL" to "Use Standard Windows Libraries"
ii) in the C/C++/Preprocessor tab, add _AFXDLL to the preprocessor definitions
iii) in the Linker/Input tab, add mfc71d.lib anywhere before osgd.lib
可是我在VC2010中按那三步修改之后,没向OSG中添加任何节点,仍然存在内存泄露:
Detected memory leaks!
Dumping objects ->
{409742} normal block at 0x038F7E90, 12 bytes long.
Data: < } P} > 90 17 83 03 08 7D 8F 03 50 7D 8F 03
{409741} normal block at 0x038F7E48, 8 bytes long.
Data: <\} > 5C 7D 8F 03 00 00 00 00
{409740} normal block at 0x038F7D50, 184 bytes long.
Data: <T(j H~ > 54 28 6A 0F 00 00 00 00 01 00 00 00 48 7E 8F 03
{409739} normal block at 0x038F7D08, 12 bytes long.
Data: < ~ { { > 90 7E 8F 03 80 7B 8F 03 C8 7B 8F 03
{409738} normal block at 0x038F7CC0, 8 bytes long.
Data: < { > D4 7B 8F 03 00 00 00 00
{409737} normal block at 0x038F7BC8, 184 bytes long.
Data: <T(j | > 54 28 6A 0F 00 00 00 00 01 00 00 00 C0 7C 8F 03
………………………………………………………………………………………………………………………………
{539} normal block at 0x002B95F0, 8 bytes long.
Data: <@ + > 40 95 2B 00 00 00 00 00
{538} normal block at 0x002B95A8, 8 bytes long.
Data: < + > 10 95 2B 00 00 00 00 00
{537} normal block at 0x002B94A8, 196 bytes long.
Data: <$ > 24 05 18 10 00 00 00 00 07 00 00 00 00 00 00 00
Object dump complete.
复制代码
请问在VC2010里要怎样才能解决OSG内在泄露的问题呀?
mfc71d.dll文件也都下载了 ,放到系统文件夹了
http://www.dlldq.com/files/mfc71d.dll.html
另外,还想问两个问题:
1、我的OSG编译时使用了UTF-8支持,那么在osgMFC中是不是也必须设置“使用 Unicode 字符集”?如果设置成“使用多字节字符集”会出现什么问题吗?
2、网上说通过上面的三步修改Debug设置后,必须设置“使用多字节字符集”,如果设置“使用 Unicode 字符集”则会报error LNK2019的链接错误。怎样解决在“使用 Unicode 字符集”时的链接错误呀?
请高手帮帮忙啊!不胜感激。 |
|