My cygwin gcc report conflicting types error when building dynamic link library using JNI

32 Views Asked by At

I was using cygwin gcc (7.4.0-x64) on windows to build dynamic link library for java.

Here reports the error: H:\ddlog/java/ddlogapi.c:1057:28: error: conflicting types for 'Java_ddlogapi_DDlogAPI_ddlog_1is_1int' JNIEXPORT jboolean JNICALL Java_ddlogapi_DDlogAPI_ddlog_1is_1int( ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from H:\ddlog/java/ddlogapi.c:12:0: H:\ddlog/java/ddlogapi_DDlogAPI.h:423:28: note: previous declaration of 'Java_ddlogapi_DDlogAPI_ddlog_1is_1int' was here JNIEXPORT jboolean JNICALL Java_ddlogapi_DDlogAPI_ddlog_1is_1int

It seems to me that there is no difference between these two return types, why this error happen anyway? Can anyone help me figure this out and how to solve this problem?

I have successfully built java library in linux using cc command, which is gcc (7.5.0-x64), so I pretty sure there is no problem in the above .c and .h files, could it be the platform-specific difference that invoke this error?

0

There are 0 best solutions below