我想創建一個將調用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