This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: typedef conflict in GCC and JAVA


Hi Andrew,

I am doing the following #include in my source:-

#include <jni.h>

And in the compilation command my include path is
-I/opt/jdk1.5/include

Thanks,
-Dhiraj

-----Original Message-----
From: Andrew Haley [mailto:aph-gcc@littlepinkcloud.COM] 
Sent: Friday, June 22, 2007 4:06 PM
To: Dhiraj Nilange-DD
Cc: gcc-help@gcc.gnu.org
Subject: Re: typedef conflict in GCC and JAVA

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]