Building a JNI DLL Using MINGW

I am trying to create a DLL that will call Qt (currently I cannot use Jambi for the functionality I need). I have a simple Java method:

public final native int createChild(int handle);

I created a C project in Visual Studio Express 2010 and was able to create a DLL.

Then I created a project in the creator of Qt and moved my sources there. I tried to customize the assembly as far as I know, but all I get is:

java.lang.UnsatisfiedLinkError: tools.proofofconcept.control.EmbedderComposite.createChild(I)I

I assume that the character is not exported properly from the DLL. I added -D_JNI_IMPLEMENTATION_ linker arg:

g++ -D_JNI_IMPLEMENTATION_  -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -shared -mthreads -Wl -Wl,--out-implib,debug\libqt_integration.a -o debug\qt_integration.dll debug/dllmain.o debug/nativecode.o debug/qmfcapp.o debug/qwinwidget.o debug/moc_qwinwidget.o  -L"c:\Qt\2010.05-rc1\qt\lib" -lQtGuid4 -lQtCored4 
+5
source share
2 answers

I should have added the following argument:

-Wl,--kill-at

It will change the format of the exported characters.

+6
source

Qt, , . "" ( "mkspecs/default" ), win32 "UnsatisfiedLinkError".

+2

All Articles