Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8271735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:55:21+00:00 2026-06-08T06:55:21+00:00

The following code snippet causes error….the logcat has been attached…I am tring to pass

  • 0

The following code snippet causes error….the logcat has been attached…I am tring to pass the image path from teh java code to the NDK code and from there I am trying to open the bitmap using FreeImage library….

JNIEXPORT void JNICALL Java_com_example_ImageActivity_brightness(JNIEnv* env, jobject  obj, jstring bitmappath, jfloat brightnessValue)
{
    AndroidBitmapInfo  info;

    int ret;
    void* pixels;

    if ( !bitmappath ) LString();

       const jsize len      = env->GetStringUTFLength(bitmappath);
       const char* strChars = env->GetStringUTFChars(bitmappath, (jboolean *)0);

       std::string Result(strChars, len);

       env->ReleaseStringUTFChars(bitmappath, strChars);

     FIBITMAP *bitmap = FreeImage_Load(FIF_BMP,Result.c_str(), BMP_DEFAULT);
     if (bitmap) {
    // bitmap successfully loaded!
        FreeImage_Unload(bitmap);
    }

Error log

flock@QS57:~/Desktop/android-imagefilter-ndk$ /home/flock/ANDROID/android-ndk-r8/ndk-build
Compile thumb  : imageprocessing <= imageprocessing.c
jni/imageprocessing.c: In function 'Java_com_example_ImageActivity_brightness':
jni/imageprocessing.c:77: error: request for member 'GetStringUTFLength' in something not a structure or union
jni/imageprocessing.c:78: error: request for member 'GetStringUTFChars' in something not a structure or union
jni/imageprocessing.c:80: error: expected expression before ':' token
jni/imageprocessing.c:82: error: request for member 'ReleaseStringUTFChars' in something not a structure or union
jni/imageprocessing.c:84: error: 'FIBITMAP' undeclared (first use in this function)
jni/imageprocessing.c:84: error: (Each undeclared identifier is reported only once
jni/imageprocessing.c:84: error: for each function it appears in.)
jni/imageprocessing.c:84: error: 'bitmap' undeclared (first use in this function)
jni/imageprocessing.c:84: error: 'FIF_BMP' undeclared (first use in this function)
jni/imageprocessing.c:84: error: 'Result' undeclared (first use in this function)
jni/imageprocessing.c:84: error: 'BMP_DEFAULT' undeclared (first use in this function)
make: *** [obj/local/armeabi/objs/imageprocessing/imageprocessing.o] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:55:22+00:00Added an answer on June 8, 2026 at 6:55 am

    The way you are calling JNI functions is possible only if you compile code as C++ code.

    If you need or want to compile code as C then you must write JNI calls in following way:

    const jsize len      = (*env)->GetStringUTFLength(env, bitmappath);
    const char* strChars = (*env)->GetStringUTFChars(env, bitmappath, (jboolean *)0);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Environment: Seam, Richfaces The following code snippet causes the method getUsers to be called
The following code snippet is from The Official GNOME 2 Developer's Guide : GMemChunk
Why does following code snippet doesn't work? It doesn't gives any error, but also
I have the following code snippet.. I get the error Expected identifier, string or
I want to pull posts from a users Facebook wall. The following code snippet
I have the following php code, which has been snipped for brevity. I am
The following code snippet on SQL server 2005 fails on the ampersand '&': select
The following code snippet attempts to create a Tib DaemonManager connecting to a particular
The following code snippet generates some warning messages when compiling: Cluster& Myclass::getCluster(const Point &p)
In the following code snippet: NSMutableArray *tmpItemsArray =[[[NSMutableArray alloc] init] autorelease]; while (sqlite3_step(fetch_statement)==SQLITE_ROW){ int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.