delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/02/16:22:15

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <33AB9F0F694ED311B5810000C0AAE4F408DA3B6C@gab200po08.ems.att.com>
From: "Fowler, John P, CFCTR" <jpfowler AT att DOT com>
To: Mike Fahlbusch <mcf AT cobweb DOT com DOT au>
Cc: "Cygwin (E-mail)" <cygwin AT cygwin DOT com>
Subject: RE: HELP Please!!!!! Problem compiling JNI program under g++
Date: Fri, 2 Mar 2001 16:20:19 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)

Mike,
I have no problems compiling the "c" program under gcc but the c++ compiler
chokes with parser errors.  I tried breaking the statement in pieces like
you suggested and I got the same error message for the line with the first
"*".  I did remove the first () on the first line in error and that stopped
the error on that line only.  I would hate to take ownership of the jni.h
file to be able to compile a JNI program on my PC.  

Do you have any other thoughts??

John Fowler

-----Original Message-----
From: Mike Fahlbusch [mailto:mcf AT cobweb DOT com DOT au]
Sent: Thursday, March 01, 2001 9:38 PM
To: Fowler, John P, CFCTR
Subject: Re: HELP Please!!!!! Problem compiling JNI program under g++


At 16:11 01-03-01 -0500, you wrote:
[snip]

>I am trying to setup an environment under Win NT where I can experiment
with
>C++/JNI programs. When I try to compile the sample C++ program available at
>http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ with g++ I get a
>long list of errors caused by the jni.h file. I made the recommended
>changes to the jlong typedef as described at the site referenced above but
>when I compile the sample program I get the following error
>everywhere JNICALL is used:
>
>    jdk1.2.2/include/jni.h:200: parse error before `*'
>
>I looked at jni.h and line 200 is:
>    jint (JNICALL *GetVersion)(JNIEnv *env);
>
>JNICALL is defined as #define JNICALL __stdcall.
>
>I tried compiling the application under JDK1.2 and JDK1.3 but I still get
>the same error. Any suggestion on what I may be missing???


Perhaps some compilers can't handle statements of the form:

type (ptr)(ptr)

If you break up the statement like this it might give you a tip:

>   jint
>(JNICALL
>*
>GetVersion)
>(JNIEnv
>*
>env);

If you can rephrase the statement to get rid of the ()() or one of the ptrs 
it might help.

Simply deleting the JNICALL might help, many compilers can do without 
stdcall for a few statements.

Also jint might not be a simple type, there could be a compound type or 
something like typedef in its base declaration.  Some compilers can't 
handle multiple casts or can't do things like have extern and typedef in 
the same statement.

If you work it out please tell me how you did it.

-
Regards,
        Mike

Sig:
"Attitude is no substitute for Competence."
Hack.org

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019