🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
1 messages
1 total messages Started by Raffi Ismail Wed, 14 Aug 2002 04:50
Borland C++ Compiler / Java Bug with JNI?
#905
Author: Raffi Ismail
Date: Wed, 14 Aug 2002 04:50
18 lines
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?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads