JNI system.loadlibrary 问题 - 原生 C++使用C库的dll
我有一个非常烦人的编译问题。
我试图在 VS2010 中的 C++ DLL 上执行 System.loadlibrary,而该 DLL 又使用在 VS2008 中编译的 C DLL。
我收到的错误是: java.lang.UnsatisfiedLinkError:应用程序无法启动,因为 它的并行配置不正确
每当我的 C++ DLL 尝试调用 C DLL 中的函数时就会发生这种情况。两者都编译得很好,并且都位于 Java Applet 可以访问的文件夹中。
这有可能以某种方式解决吗?您需要更多信息吗?
I have a pretty annoying compiling problem.
I am trying to do a System.loadlibrary on a C++ DLL in VS2010, which in turns uses a C DLL compiled in VS2008.
The error I am getting is:
java.lang.UnsatisfiedLinkError: The application has failed to start because
its side-by-side configuration is incorrect
This occurs whenever my C++ DLL tries to do a call to a function in the C DLL. Both compiles just fine, and both are in a folder accessible by Java Applet.
Is this possible to solve somehow? Do you need any more info?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该尝试在 DLL 上使用 dependency walker。
从并行错误中,我假设 c 运行时 redist 包之一或 noredist 包之一丢失。
但巡查员应该向你展示这一点。
如果这没有帮助,您可以从 Windows 事件日志中获取更多信息,因为其中会记录并排错误,或者您需要使用 sxstrace 来获取更多信息。
You should try and use the dependency walker on your DLLs.
From the side-by-side error I assume that one of the c runtime redist packages or one of the noredist packages is missing.
But the dep walker should show you this.
If this does not help you can get some more information from the event log of Windows since side by side errors are logged there, or you need to use sxstrace for more info.
您是否安装了VC2010和VC2008的运行库?
此外,您必须确保两个 DLL 的清单均已正确配置,以便可以加载所用库的正确版本。
另请参阅:http://msdn.microsoft.com/en-us/library/ ms235342.aspx
Have you installed the runtimes of VC2010 and VC2008?
Additionally you have to make sure the manifests of both DLLs are correctly configured so that the correct version of the used library can be loaded.
See also: http://msdn.microsoft.com/en-us/library/ms235342.aspx