症状:
VS2005,使用OSG2.8.3库的程序,Debug配置运行时,会提示找不到读字体或者纹理的文插件,可是这些插件的动态链接库,我的BIN目录里面的确有。
Release下正常。
说明:
1.依赖项中的lib库已经检查过是d和非d区分的。
2.编译通过,include和lib目录正确。
3.windows 2003 x64 r2 with sp2
4.VS2005,使用win32配置。
5.osgversion 2.8.2
原因:主要是所依赖的第三方库插件生成的dll文件与OSG编译所用的VS版本不一致造成的。VS不能使用混合版本debug才会这样。
就意味着如果程序LoadLibrary加载了使用其他版本的VC编译的dll库,就只能一直使用Relese版本
可见插件里面的说明:
This is a package of prebuilt 3rd party dependency libraries for use
with the OpenSceneGraph http://openscenegraph.org/
These binaries were built using on Microsoft WindowsXP SP2 using
Visual Studio 2005 (8.0) SP1, with minimal modifications to the
makefiles/projectfiles for consistent use of the "multi-threaded DLL"
(i.e.: /MD and /MDd) versions of the Visual Studio runtime libraries.
NOTE: You must have Visual Studio 2005 Service Pack 1 installed to use
these prebuilt binaries.
注意:中文版的下载中文的,英文的必须是英文的。装的过程可能比vs2005安装还要慢,同时网络必须保持正常链接。
解决方法:安装补丁包以后,需要重新编译OSG生成新的库文件,头文件及动态链接文件。之后一切正常。
以后再使用不熟悉的软硬件是,先简单看一下说明,或许就不会郁闷这么久了