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. ListView and TextView in a LinearLayout - issue

I am trying to render a ListView and a TextView within a LinearLayout.
That activity is inherited from ListActivity.
The problem I am running into is Listview and TextView are not getting
arranged properly one below the other in the layout.
basically they getting rendered side by side.
Need help..
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
      android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

  <TextView android:id="@+android:id/test"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="test test"
        />
  <ListView android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        />
</LinearLayout>

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

2. how to show yuv picture in android?

In cameraservice.cpp, it uses the following code to show picture in
format yuv420.

mSurface->registerBuffers(w,h,w,h,
                             PIXEL_FORMAT_YCbCr_420_SP,
                                  mHardware->getPreviewHeap());

But there's no color shown on the screen. It seems as that only luma
data was processed.

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

3. 3D/GL View on top of a SurfaceView?

4. Sound interfering with Accelerometer and Orientation sensors

5. Layer a 3D/GL View on top of a SurfaceView?

6. how android connects to a specific AP?

7. Cannot access to the Internet on only my App....