build JNI C code fail ???

by Keroro » Mon, 27 Apr 2009 16:23:49 GMT


Sponsored Links
 Why build error?

build and Error Message:
.../mydroid$ make libmax
target thumb C: libmax <= development/max/max.c
development/max/max.c: In function 'Java_testdll_set':
development/max/max.c:7: error: parameter name omitted
development/max/max.c:7: error: parameter name omitted
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libmax_intermediates/max.o] Error 1

code as follows:

max.c
=======================================================================
#include <jni.h>
JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint);

 int i = 0;

    JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint
j)
      {
       i = j;
      }
=======================================================================

Android.mk
================================
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \

    max.c

LOCAL_C_INCLUDES := \

    $(JNI_H_INCLUDE)

LOCAL_SHARED_LIBRARIES := \

    libutils

LOCAL_PRELINK_MODULE := false

LOCAL_MODULE := libmax

include $(BUILD_SHARED_LIBRARY)
==================================

--~--~---------~--~----~------------~-------~--~----~



build JNI C code fail ???

by Keroro » Mon, 27 Apr 2009 16:34:48 GMT


 build JNI C code fail ???

Why build error?

build and Error Message:
.../mydroid$ make libmax
target thumb C: libmax <= development/max/max.c
development/max/max.c: In function 'Java_testdll_set':
development/max/max.c:7: error: parameter name omitted
development/max/max.c:7: error: parameter name omitted
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libmax_intermediates/max.o] Error 1

code as follows:

max.c
=======================================================================
#include <jni.h>
JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint);

 int i = 0;

    JNIEXPORT void JNICALL Java_testdll_set (JNIEnv *, jclass, jint
j)
      {
       i = j;
      }
=======================================================================

Android.mk
================================
LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \

    max.c

LOCAL_C_INCLUDES := \

    $(JNI_H_INCLUDE)

LOCAL_SHARED_LIBRARIES := \

    libutils

LOCAL_PRELINK_MODULE := false

LOCAL_MODULE := libmax

include $(BUILD_SHARED_LIBRARY)
==================================

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


build JNI C code fail ???

by MrSnowflake » Mon, 27 Apr 2009 19:58:33 GMT


 Probably because JNI is not supported.



--~--~---------~--~----~------------~-------~--~----~



build JNI C code fail ???

by Michael MacDonald » Mon, 27 Apr 2009 23:32:03 GMT


 


You need to supply variable names for all your function parameters, not
just jinit j.




--~--~---------~--~----~------------~-------~--~----~



build JNI C code fail ???

by Keroro » Tue, 28 Apr 2009 20:42:52 GMT


 Thank you, have been solution.

On 47 119 Michael MacDonald <googlec...@antlersoft.com>




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Return value for a PendingIntent launched via a Notification

Hello,

Is is possible to get back a result intent when launching an Intent
from a Notification?

Similar to the way startActivityForResult() works ?

Thanks,
Serge

-- 

2. Compile Help

I have attempted many times to use the make function on the android
source
This is the following error I am always receiving, I highly doubt its
my source because i have redownloaded the source multiple times. Could
any shed some light or a gentle nudge in the right direction?


Install: out/target/product/sholes-open/system/lib/
libopencore_streamingreg.so
target thumb C++: libopencorehw <= hardware/ti/omap3/libopencorehw/
android_surface_output_omap34xx.cpp
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
In constructor
'AndroidSurfaceOutputOmap34xx::AndroidSurfaceOutputOmap34xx()':
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
78: error: 'mNumberOfFramesToHold' was not declared in this scope
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
In member function 'virtual void
AndroidSurfaceOutputOmap34xx::setParametersSync(void*, PvmiKvp*, int,
PvmiKvp*&)':
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
289: error: 'class PVMFYuvFormatSpecificInfo0' has no member named
'width'
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
293: error: 'class PVMFYuvFormatSpecificInfo0' has no member named
'height'
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
297: error: 'class PVMFYuvFormatSpecificInfo0' has no member named
'display_height'
hardware/ti/omap3/libopencorehw/android_surface_output_omap34xx.cpp:
302: error: 'class PVMFYuvFormatSpecificInfo0' has no member named
'display_width'
make: *** [out/target/product/sholes-open/obj/SHARED_LIBRARIES/
libopencorehw_intermediates/android_surface_output_omap34xx.o] Error 1

-- 

3. Latin characters in EditText Android

4. Android Emulator problem

5. What does targetSdkVersion do?

6. Android groups access method

7. accessing and changing Sync setting for android 1.5, 1.6 and more