0
我想在使用C++的Netbean中構建以下內容。但是我無法這樣做。我收到以下錯誤。在C++中構建DLL文件Netbeans
gcc -shared -m32 -o dist/libJNIDemoCdl.so build/Debug/Cygwin-Windows/JNIDemo.o -mno-cygwin -shared gcc: error: unrecognized command line option ‘-mno-cygwin’
我只能夠建立這種使用以下命令手動
gcc -shared -o dist/libJNIDemoCdl.so build/Debug/Cygwin-Windows/JNIDemo.o -Wall -D_JNI_IMPLEMENTATION_ -Wl,--kill-at
如何解決與netbean IDE這個問題?
頭文件
#include <stdint.h>
#include <jni.h>
/* Header for class jnidemojava_Main */
#ifndef _Included_jnidemojava_Main
#define _Included_jnidemojava_Main
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: jnidemojava_Main
* Method: nativePrint
* Signature:()V
*/
JNIEXPORT void JNICALL Java_jnidemojava_Main_nativePrint
(JNIEnv *, jobject);
#ifdef __cplusplus
}
#endif
#endif
源
#include <jni.h>
#include <stdio.h>
#include "JNIDemoJava.h"
JNIEXPORT void JNICALL Java_jnidemojava_Main_nativePrint
(JNIEnv *env, jobject obj)
{
printf("\nHello World from C\n");
}