typedef conflict in GCC and JAVA
Andrew Haley
aph-gcc@littlepinkcloud.COM
Fri Jun 22 11:39:00 GMT 2007
Dhiraj.Nilange@iflexsolutions.com writes:
> I have GCC 4.1.1. I am trying to compile one C++ code using g++.
>
> I am wondering what's the use of the following file?
>
> usr/lib/gcc/x86_64-redhat-linux/4.1.1/include/jni_md.h
>
> As you can see this is in the gcc related include directory. But I am
> getting compilation errors due to this file. The thing is one of the
> datatypes defined in this header file is creating conflict with other
> datatype with the same name in another Java related headerfile (file
> and path shown below):-
>
> /opt/jdk1.5/include/jni.h
That's Sun's jni.h.
> The actual conflict is:-
>
> The file jni.h has the following declaration:-
>
> typedef unsigned char jboolean;
>
> Whereas in the file jni_md.h there is following declaration(s):-
>
> typedef int jboolean __attribute__((__mode__(__QI__)));
> typedef int8_t jboolean;
That file belings to gcj.
> The compilation error I get is this:-
>
> error: ?jboolean? has a previous declaration as ?typedef signed char
> jboolean?
>
>
> Can someone pls explain?
What files are you #including in your source? What is your include path?
Andrew.
More information about the Gcc-help
mailing list