IT Learner wrote:
> I am asking a very naive question.
> I have a simple C++ file called JNI_Wrapper.cpp which calls some 3rd party APIs which are in C:\Mobile\distro\lib\com_api.dll, and I haver installed the MinGW 5.1.4 on Windows XP. I can see the gcc/g++ on C:\MinGW\bin directory.
> What is the MinGW command (just a simple command) to compile the JNI_Wrapper.cpp into a Windows DLL so that I can invoke it from the Java program?
> BTW, it would be perfect if you guys know any open source Java utilities which would enable me to directly call 3rd party C/C++ API in a DLL. I found one NON OPEN SOURCE Java utility called jinvoke could do it.
to build a dll out of the source file, use:
"g++ -shared JNI_Wrapper.cpp -Wl,--out-implib,libJNI_Wrapper.dll.a"
More here: <http://www.mingw.org/MinGWiki/index.php/sample%20DLL>
Sorry, I have no experience in Java at all.