我想创建一个将调用Qt的DLL(目前我无法使用Jambi来获得我需要的功能)。我有一个简单的Java方法:使用MINGW建立一个JNI DLL
public final native int createChild(int handle);
我在Visual Studio Express 2010中创建了C项目,并且能够构建DLL。
然后,我在Qt创建者中创建了一个项目,并将其源移动到那里。我试图构建配置到我所知,但我得到的是:
java.lang.UnsatisfiedLinkError: tools.proofofconcept.control.EmbedderComposite.createChild(I)I
我的猜测是,符号不正确地从DLL导出。我加-D_JNI_IMPLEMENTATION_连接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