Tag: mingw

java.lang.UnsatisfiedLinkError – JNI

每次运行程序时,我都会收到java.lang.UnsatisfiedLinkError错误。 我有一个本机,一个包装器,以及通过包装器调用本机的程序。 main.h #ifndef __MAIN_H__ #define __MAIN_H__ #include #ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT __declspec(dllimport) #endif #include #include using namespace std; extern “C” { JNIEXPORT void JNICALL native_MessageBox(string text, string title); } #endif main.cpp中 #include “main.h” #include #include using namespace std; JNIEXPORT void JNICALL MsgBox(string text, string title) { MessageBox(NULL, text.c_str(), title.c_str(), MB_OK); […]

NetBeans 7.2 MinGW为OpenCV安装

我已根据http://netbeans.org/community/releases/72/cpp-setup-instructions.html在我的电脑上安装了minGW,并且我使用已找到所有必要文件的NetBeans 7.2“恢复了默认值”。 但是当我制作测试样本C ++应用程序时出现以下错误: c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -ladvapi32 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lshell32 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -luser32 c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lkernel32 collect2: ld returned 1 exit status make[2]: *** [dist/Debug/MinGW-Windows/welcome_1.exe] Error 1 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 任何人都可以帮我安装openCV和minGW for NetBeans吗?

64位系统上的Java Native Interface 32位dll

E:\Code\Java\JNITest>java test Exception in thread “main” java.lang.UnsatisfiedLinkError: E:\Code\Java\JNITest\test.dll: Can’t load IA 32-bit .dll on a AMD 64-bit platform at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) at test.main(test.java:16)` 使用Java Native Interface时遇到了导致此错误的问题。 我相信这是因为我使用MinGW编译了.dll,它编译成32位.dll而我的系统是64位,因此我的Java运行在64位。 反正有没有迫使我的Java以32位运行?