Article View: borland.public.jbuilder.java.api
Article #905Borland C++ Compiler / Java Bug with JNI?
From: Raffi Ismail
Date: Wed, 14 Aug 2002 04:50
Date: Wed, 14 Aug 2002 04:50
18 lines
2147 bytes
2147 bytes
I have the following code in my Native implementation of some JNI code. A java class needs to call the setInputValues(int, float[]) native function in my DLL.
<br>------------------------------------------
<br>JNIEXPORT void JNICALL Java_Ryno_setInputValues (JNIEnv *env, jobject obj, jint _n, jfloatArray _v)
*nbsp;{
*nbsp;*nbsp;jfloat *tmp = (*env)->GetFloatArrayElements(env, _v, 0);
*nbsp;*nbsp; for (int i = 0; i < _size_in; i++)
*nbsp;*nbsp;{
*nbsp;*nbsp;*nbsp;inputLayer[i].acc = tmp[i];
*nbsp;*nbsp;}
*nbsp;*nbsp;(*env)->ReleaseFloatArrayElements(env, _v, tmp, 0);
}
<br>---------------------------------------
Here's the problem, when I compile i get the following <b>error:Error E2288 J:\C\FeatureMap.hpp 62: Pointer to structure required on left side of -> or ->* in function __stdcall Java_Ryno_setInputValues(JNIEnv_ *,_jobject *,long,_jfloatArray *)
<br>Error E2288 J:\C\FeatureMap.hpp 67: Pointer to structure required on left side of -> or ->* in function __stdcall Java_Ryno_setInputValues(JNIEnv_ *,_jobject *,long,_jfloatArray *)</b>
<br>
<br>
I know what the error means but this code has been adapted from Sun's tutorials. *env is a pointer, so what happened?
Technical Details
Message-ID:
<3d59e1ac$1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!207.8.186.117.MISMATCH!grr!newsprint.netaxs.com!128.230.129.106.MISMATCH!news.maxwell.syr.edu!news1.optus.net.au!optus!news.mel.connect.com.au!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,ca40a8a8212c8bd7,start X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-08-13 22:10:19 PST From: "Raffi Ismail" <ismail_raffi@yahoo.com> Sender: "Raffi Ismail" <ismail_raffi@yahoo.com> Reply-To: "Raffi Ismail" <ismail_raffi@yahoo.com> Subject: Borland C++ Compiler / Java Bug with JNI? Newsgroups: borland.public.jbuilder.java.api X-User-Info: 203.124.0.245 203.124.0.245 NNTP-Posting-Host: 207.105.83.65 Message-ID: <3d59e1ac$1@dnews> Date: 13 Aug 2002 21:50:52 -0700 X-Trace: dnews 1029300652 207.105.83.65 (13 Aug 2002 21:50:52 -0700) Lines: 19 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!207.8.186.117.MISMATCH!grr!newsprint.netaxs.com!128.230.129.106.MISMATCH!news.maxwell.syr.edu!news1.optus.net.au!optus!news.mel.connect.com.au!news.xtra.co.nz!newsfeeds.ihug.co.nz!ihug.co.nz!dnews!not-for-mail