создание DLL для JNI в проблеме Netbeans - PullRequest
1 голос
/ 16 августа 2010

Я пытаюсь создать DLL для использования с Java JNI. Я использую плагин Netbeans C / C ++ для создания DLL.

но после компиляции я получаю следующую ошибку (объекты .o уже созданы)

есть идеи? я что-то упустил?

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Entering directory `/c/projects/hdijni'
rm -f -r build/Debug
rm -f dist/Debug/MinGW-Windows/libhdijni.dll
make[1]: Leaving directory `/c/projects/hdijni'

CLEAN SUCCESSFUL (total time: 18s)
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/projects/hdijni'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/libhdijni.dll
make[2]: Entering directory `/c/projects/hdijni'
mkdir -p build/Debug/MinGW-Windows/src
rm -f build/Debug/MinGW-Windows/src/ByteJNI.o.d
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32   -c -g -Isrc/Windows -Isrc -I../../MinGW/jni/include/win32 -I../../MinGW/jni/include  -MMD -MP -MF build/Debug/MinGW-Windows/src/ByteJNI.o.d -o build/Debug/MinGW-Windows/src/ByteJNI.o src/ByteJNI.c
gcc.exe: --add-stdcall-alias: linker input file unused because linking not done
mkdir -p build/Debug/MinGW-Windows/src
rm -f build/Debug/MinGW-Windows/src/HDIJNI.o.d
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32   -c -g -Isrc/Windows -Isrc -I../../MinGW/jni/include/win32 -I../../MinGW/jni/include  -MMD -MP -MF build/Debug/MinGW-Windows/src/HDIJNI.o.d -o build/Debug/MinGW-Windows/src/HDIJNI.o src/HDIJNI.c
gcc.exe: --add-stdcall-alias: linker input file unused because linking not done
mkdir -p build/Debug/MinGW-Windows/src
rm -f build/Debug/MinGW-Windows/src/common.o.d
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32   -c -g -Isrc/Windows -Isrc -I../../MinGW/jni/include/win32 -I../../MinGW/jni/include  -MMD -MP -MF build/Debug/MinGW-Windows/src/common.o.d -o build/Debug/MinGW-Windows/src/common.o src/common.c
gcc.exe: --add-stdcall-alias: linker input file unused because linking not done
mkdir -p build/Debug/MinGW-Windows/src
rm -f build/Debug/MinGW-Windows/src/Generic.o.d
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32   -c -g -Isrc/Windows -Isrc -I../../MinGW/jni/include/win32 -I../../MinGW/jni/include  -MMD -MP -MF build/Debug/MinGW-Windows/src/Generic.o.d -o build/Debug/MinGW-Windows/src/Generic.o src/Generic.c
gcc.exe: --add-stdcall-alias: linker input file unused because linking not done
mkdir -p build/Debug/MinGW-Windows/src/Windows
rm -f build/Debug/MinGW-Windows/src/Windows/win.o.d
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32   -c -g -Isrc/Windows -Isrc -I../../MinGW/jni/include/win32 -I../../MinGW/jni/include  -MMD -MP -MF build/Debug/MinGW-Windows/src/Windows/win.o.d -o build/Debug/MinGW-Windows/src/Windows/win.o src/Windows/win.c
gcc.exe: --add-stdcall-alias: linker input file unused because linking not done
mkdir -p dist/Debug/MinGW-Windows
gcc.exe -mno-cygwin -Wl,--add-stdcall-alias -shared -m32    -shared -o dist/Debug/MinGW-Windows/libhdijni.dll build/Debug/MinGW-Windows/src/ByteJNI.o build/Debug/MinGW-Windows/src/HDIJNI.o build/Debug/MinGW-Windows/src/common.o build/Debug/MinGW-Windows/src/Generic.o build/Debug/MinGW-Windows/src/Windows/win.o  
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `callRuntimePropertiesMethod':
C:/projects/hdijni/src/HDIJNI.c:142: multiple definition of `callRuntimePropertiesMethod'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:288: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `closeJVM':
C:/projects/hdijni/src/HDIJNI.c:192: multiple definition of `closeJVM'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:402: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getFailedCalls':
C:/projects/hdijni/src/HDIJNI.c:251: multiple definition of `getFailedCalls'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:800: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getJNIStatus':
C:/projects/hdijni/src/HDIJNI.c:266: multiple definition of `getJNIStatus'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:900: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getStrategyInfo':
C:/projects/hdijni/src/HDIJNI.c:282: multiple definition of `getStrategyInfo'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1090: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getSuccessfulCalls':
C:/projects/hdijni/src/HDIJNI.c:339: multiple definition of `getSuccessfulCalls'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1154: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getTotalDACalls':
C:/projects/hdijni/src/HDIJNI.c:354: multiple definition of `getTotalDACalls'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1169: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `getTotalDACallsFor':
C:/projects/hdijni/src/HDIJNI.c:375: multiple definition of `getTotalDACallsFor'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1190: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `initialiseJVM':
C:/projects/hdijni/src/HDIJNI.c:464: multiple definition of `initialiseJVM'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1229: first defined here
build/Debug/MinGW-Windows/src/HDIJNI.o: In function `loadStrategy':
C:/projects/hdijni/src/HDIJNI.c:836: multiple definition of `loadStrategy'
build/Debug/MinGW-Windows/src/ByteJNI.o:C:/projects/hdijni/src/ByteJNI.c:1907: first defined heremake[2]: Leaving directory `/c/projects/hdijni'
make[1]: Leaving directory `/c/projects/hdijni'

collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/MinGW-Windows/libhdijni.dll] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 1s)

1 Ответ

1 голос
/ 16 августа 2010

извините, ребята,

это была проблема с дублированием методов;)

вопрос закрыт.

...