Java加载DLL,该DLL从JNI中的另一个DLL导出方法
Java loading a DLL that export methods from another DLL in JNI
我做了一个从JNI中的另一个DLL导出的DLL。
JNIEXPORT bool JNICALL getIsWordInPhonemListFR(const char* word)
{
isWordInPhonemListFR method = NULL;
BOOL fRunTimeLinkSuccess = FALSE;
HINSTANCE hGetProcIDDLL = LoadLibrary(L"PhoneticEngineFR2.dll");
if (!hGetProcIDDLL) {
std::cout << "kcould not load the dynamic library" << std::endl;
}else{
method = (isWordInPhonemListFR)GetProcAddress(hGetProcIDDLL, "isWordInPhonemListFR");
}
return method(word);
}
system。加载Java中没有任何错误,但是当我想使用本机方法时,我会得到
java.lang.unsatisfiedlinkerror:
两个dll在我的项目中的同一文件夹中。在Visual Studio工作时工作正常,但是JNI的出口出现了问题。JNI on Load也没有触发Java。
谢谢
我很愚蠢,我在所有JNI导出方法上都有一个名称空间。因此,他们没有被执行。现在起作用。
相关文章:
- 在 Windows 上,是否可以让 dll 在不使用 PATH 环境变量的情况下在另一个文件夹中查找依赖项?
- 在 C++/CLI 中将 .NET 事件从一个 DLL 引发到另一个 DLL
- C++ |DLL / EXE - 如何从导出的类调用另一个类方法?
- 引用另一个文件夹中的.dll
- C++将包含的库 (ref DLL) 从根目录更改为另一个位置
- 将 std::string 作为参数从一个 DLL 传递到另一个 DLL 引发访问冲突错误
- Java加载DLL,该DLL从JNI中的另一个DLL导出方法
- 如何在另一个 DLL 上使用 '/DELAYLOAD' 的 DLL
- 当从一个应用程序调用时,在DLL方法中创建COM接口指针是有效的,但当从另一个应用软件调用时则无效
- 在另一个项目中将模板函数用作dll
- 用C++为java构建一个dll,它正在调用另一个dll(Eclipse上的JNI)
- 是否有从另一个DLL中加载DLL的最佳实践
- Dll 注入 - 在另一个进程中编写本机代码
- 如何将dll注入另一个进程
- 如何正确删除从另一个DLL接收的派生对象
- 在 jmpq 上崩溃到另一个 dll 中的函数与 mingw64
- 将一个 dll 导入另一个 dll C++
- Visual Studio,C++,在另一个DLL导出的类中使用DLL导出的类
- 一个C++客户端无法使用我们新的 COM 注册的 .NET .dll加载,另一个客户端可以正常工作
- 从另一个 dll 链接动态 dll 会导致错误