Unity3D DllNotFoundException/System.DllNotFoundException

原地址:http://hi.baidu.com/next2_me/item/3a70c1cc6b2fc6320931c622

Unity3D DllNotFoundException/System.DllNotFoundException

Unity System.DllNotFoundException

Unity Fallback handler could not load library D:/91yGame/SparrowCD_Data/Mono/.\D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

Unity3D Fallback handler could not load library D:/91yGame/SparrowCD_Data/Mono/.\D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

 

Unity System.DllNotFoundException: D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

Unity3D System.DllNotFoundException: D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

Unity DllNotFoundException: D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

Unity3D DllNotFoundException: D:/91yGame/SparrowCD_Data/Plugins/GAME3D.dll

笔者在开发完游戏后,在绝大部分的客户机都是正常运行的,但是某些玩家就是不能启动游戏。重新下载也一样。这很可能和系统环境有些关系了,引用dll都是放在plugins的。

通过日志发现 很多日志都是上面的内容,Fallback handler could not load library,游戏大厅c++通讯dll调用失败了。

通过分析,可以明确:

1:GAME3D.dll在大部分机器可以调用,说明DLL函数正确导出。 

2:C#导入方法

    [DllImport(@"GAME3D", EntryPoint = "SetCallbackTemp", CharSet = CharSet.Ansi)]
    public extern static void CallGameSceneNew(DegOnGameSceneNew callBack);

    在大部分机器也是ok的,函数调用也是对的。

3:GAME3D.dll依赖其他dll,而在unity规定的Plugins中找不到依赖dll。或者说某些客户端不能正常引用。

通过Depends查看,我们发现这个通讯dll依赖MFC90.dll MSVCR90.dll,MSVCP90.dll了。

在出现异常的机器上把这些dll复制到unity发现目录下的Plugins下。再次启动游戏,一切正常了,虚拟机上也正常了。

这个问题在虚拟机上很容易出现,对于引用dll的项目,多多细心。

posted @ 2014-06-15 08:58  ing...  阅读(6170)  评论(1编辑  收藏  举报