🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #906

Borland C++ Compiler / Java Bug with JNI?

#906
From: Raffi Ismail
Date: Wed, 14 Aug 2002 04:52
17 lines
1904 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.

JNIEXPORT void JNICALL Java_Ryno_setInputValues (JNIEnv *env, jobject obj, jint _n, jfloatArray _v)
{
  jfloat *tmp = (*env)->GetFloatArrayElements(env, _v, 0);
  for (int i = 0; i < _size_in; i++)
  {
   inputLayer[i].acc = tmp[i];
  }
  (*env)->ReleaseFloatArrayElements(env, _v, tmp, 0);
}

Here's the problem, when I compile i get the following: 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 *)
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 *)

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: <3d59e1fe$1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!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

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,ca40a8a8212c8bd7
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-08-13 22:12:47 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: <3d59e1fe$1@dnews>
Date: 13 Aug 2002 21:52:14 -0700
X-Trace: dnews 1029300734 207.105.83.65 (13 Aug 2002 21:52:14 -0700)
Lines: 18
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!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