Unity: 在其他计算机上的独立构建中未找到本机插件

huangapple go评论59阅读模式
英文:

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文件夹中。

另外,有点奇怪的是,游戏的窗口模式设置不会在其他电脑上使用。提前感谢您,对我的英语不好感到抱歉 Unity: 在其他计算机上的独立构建中未找到本机插件

英文:

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 Unity: 在其他计算机上的独立构建中未找到本机插件

答案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.

huangapple
  • 本文由 发表于 2023年2月19日 05:55:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75496633.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定