如何强制GCC用前导下划线修饰名称?

如何强制GCC用前导下划线修饰名称?,gcc,dllexport,name-mangling,Gcc,Dllexport,Name Mangling,我用JNIJava接口函数编译DLL。 在头文件中,我有: #include <jni.h> /* Header for class net_sf_junace_UnACE */ #ifndef _Included_net_sf_junace_UnACE #define _Included_net_sf_junace_UnACE #ifdef __cplusplus extern "C" { #endif JNIEXPORT void JNICALL Java_net_sf_jun

我用JNIJava接口函数编译DLL。 在头文件中,我有:

#include <jni.h>
/* Header for class net_sf_junace_UnACE */

#ifndef _Included_net_sf_junace_UnACE
#define _Included_net_sf_junace_UnACE
#ifdef __cplusplus
extern "C" {
#endif
JNIEXPORT void JNICALL Java_net_sf_junace_UnACE_nativeACEList
  (JNIEnv *, jobject, jobject, jstring, jobject);
#ifdef __cplusplus
}
#endif
#endif
#包括
/*类网络的标题\u sf\u junace\u UnACE*/
#如果不包括净利润,则包括净利润
#定义(包括)(网络)(网络)(空间)(空间)
#ifdef_uucplusplus
外部“C”{
#恩迪夫
JNIEXPORT void JNICALL Java_net_sf_junace_UnACE_nativeACEList
(JNIEnv*,jobject,jobject,jstring,jobject);
#ifdef_uucplusplus
}
#恩迪夫
#恩迪夫

MS Visual C++修饰名为: _Java\u net\u sf\u junace\u UnACE_nativeACEList@20

通用条款: Java\u net\u sf\u junace\u UnACE_nativeACEList@20

JNI需要前导下划线。如何强制GCC生成它? -跳蚤没有帮助,为什么