英文:
Unity: Native Plugin is not found in standalone build on other computers
问题
我已经编译并导入了GameNetworkingSockets库到Unity的Plugins文件夹中。在我的电脑上进行独立构建并运行时,一切正常,但在另一台电脑上运行构建时,找不到DLL文件。我已确认DLL库包含在构建的Data/plugins文件夹中。
internal static class Native
{
private const string nativeLibrary = "GameNetworkingSockets";
[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GameNetworkingSockets_Init(IntPtr identity, StringBuilder errorMessage);
}
- 我已尝试将DLL文件移动到可执行文件旁边的根文件夹。
- 我已尝试将最小API更改为.NET Framework。
- 本机插件位于Plugins文件夹中。
另外,有点奇怪的是,游戏的窗口模式设置不会在其他电脑上使用。提前感谢您,对我的英语不好感到抱歉
英文:
I have compiled and imported the GameNetworkingSockets library into the unity Plugins folder. When doing a standalone build on my pc and running it, everything works fine, but when running the build on another pc, the dll files are not found. I have confirmed that the dll libraries are included in the builds Data/plugins folder.
internal static class Native
{
private const string nativeLibrary = "GameNetworkingSockets";
[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GameNetworkingSockets_Init(IntPtr identity, StringBuilder errorMessage);
}
- I have tried moving the dlls into the root folder next to the executable
- I have tried changing the minimal api to .net framework
- The native Plugins are in the Plugins folder
Also, which is kind of wierd, the set resolution for the game (windowed) is not used on other computers. Thanks in advance and sorry for my bad english
答案1
得分: 1
问题是,使用的库需要一些其他依赖项才能运行,这些依赖项在目标系统上不存在。例如,140Runtime dll。我通过使用依赖项查看器应用程序发现了这一点。
英文:
The Problem was, that the used library needs some other dependencies to run, which where not present on the target system. For example the 140Runtime dll. I found this out, by using the dependency walker application.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论