我写的Visual C++的dll与如下一个JNIEXPORT功能:我怎么能说JNIEXPORT功能从DLL在其他C++ DLL
extern "C"
{
JNIEXPORT int JNICALL sum()
{
return 1;
}
}
我想调用其他的Visual C这个函数+ DLL如下:
typedef int(__stdcall *f_funci)();
HINSTANCE hGetProcIDDLL = LoadLibrary("C:/.../JNIdllTest.dll");
if (!hGetProcIDDLL) {
std::cout << "could not load the dynamic library" << std::endl;
return EXIT_FAILURE;
}
f_funci funci = (f_funci)GetProcAddress(hGetProcIDDLL, "sum");
if (!funci) {
std::cout << "could not locate the function" << std::endl;
return EXIT_FAILURE;
}
std::cout << "funci() returned " << funci() << std::endl;
return EXIT_SUCCESS;
但是当我运行它,这个错误发生
无法定位功能
我该怎么办?