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 7925969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:31:53+00:00 2026-06-03T18:31:53+00:00

I found an article by Vikram Aggarwal that talks about linking Assembly code into

  • 0

I found an article by Vikram Aggarwal that talks about linking Assembly code into Android’s NDK, which even has some example code which shows how to connect the C++ code with Assembly.
( see http://www.eggwall.com/2011/09/android-arm-assembly-calling-assembly.html )

My problem is that I want to use the same function but instead of calling it from JNI stub class, I want to call my Assembly function from my private class.

But on compilation, I get the error:

error: 'armFunction' was not declared in this scope

Has anyone tried this or have any idea how to resolve this ?

Edit:

Makefile:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := quake3

# I want ARM, not thumb.
LOCAL_ARM_MODE := arm    

LOCAL_SRC_FILES := \
    multiple.s \
    macros.h \
    math/Vector2.cpp\
    math/Vector3.cpp\
    math/plane.cpp\
    engine/frustum.cpp\
    engine/BoundingVolume.cpp\
    engine/camera.cpp\
    camera-proxy.cpp\

LOCAL_CFLAGS := -DANDROID_NDK \
                -DDISABLE_IMPORTGL \

LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
#LOCAL_LDLIBS := -llog -lGLESv2

APP_STL := gnustl_static
APP_CPPFLAGS := -S -frtti -fexceptions
APP_ABI := armeabi armeabi-v7a

include $(BUILD_SHARED_LIBRARY)

Function call in cpp file:

void
Java_surreal_quake3_engine_Camera9_nativeGetDirection(JNIEnv* env, jobject thiz)
{
    //Camera* camera = (Camera*) env->GetIntField(thiz, pointerID);

    // get the _Z as the Vector3 java object
    jfieldID vector_fID = env->GetFieldID(cls, "_Z", "Lsurreal/libs/math/Vector3;");
    jobject vector_obj = env->GetObjectField(thiz, vector_fID);

    // call the setter methods on the _vecEye
        //jclass vectorClass = env->FindClass("surreal/libs/math/Vector3");
    jmethodID vector3_set = env->GetMethodID(vector3Class, "set"/*method-name*/, "(FFF)V" /*method-signature*/);
    env->CallVoidMethod(vector_obj, vector3_set, camera->getZ().x, camera->getZ().y, camera->getZ().z);

    int result = armFunction();
}
  • 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-03T18:31:58+00:00Added an answer on June 3, 2026 at 6:31 pm

    Looking at the code of the class, it seems like you call the function, but I can’t see any declaration of it, so it is not recognized. So you need to have a declaration of the function’s prototype before calling it (in the C++ class):

    Something like:

    int armFunction(void); // << declaration
    
    void Java_surreal_quake3_engine_Camera9_nativeGetDirection(JNIEnv* env, jobject thiz)
    {
        // snip - snap
        int result = armFunction(); // << your function call
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently found an article online that told me about this: RewriteRule ^mock-up/([^/]+)/([^/]+) /mock-up/index.php?page=$1&section=$2
I found this article about simple proxy server implemented in JAVA: http://www.java2s.com/Code/Java/Network-Protocol/Asimpleproxyserver.htm The code
I found an article on About.com that tells you how you can manage your
in an android website, I found an article about how to create a text
In an android website, I found an article about a widget similar to a
i found an article about self modifying code and tried to do some examples,
Googling I've found this article: http://java.dzone.com/tips/generating-client-java-code It talk about how to generate a JAVA
recently found an article in http://hashtwo.com/blog/integrating-a-file-browser-into-ckeditor-cakephp to integrate a file browser into ckeditor (file
I found the following article : here about installing fonts on a Windows computer
I copied come text from a The Huffington Post article and found that the

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.