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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:39:05+00:00 2026-06-11T04:39:05+00:00

Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := pacman LOCAL_SRC_FILES := main.cpp \

  • 0

Android.mk:

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

LOCAL_MODULE    := pacman
LOCAL_SRC_FILES := main.cpp \
        Pacman.cpp
LOCAL_CFLAGS := -DANDROID_NDK \
                -DDISABLE_IMPORTGL
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog

include $(BUILD_SHARED_LIBRARY)

In main.cpp:

void Java_com_wiagames_pacman_PacmanRenderer_nativeInit(JNIEnv* env) {
...
}

The package is com.wiagames.pacman; The Java class, containing the nativeInit method, is PacmanRenderer in the com.wiagames.pacman package.
It works fine before I added pacman.cpp, but after adding it I have:

E/AndroidRuntime( 2238): FATAL EXCEPTION: GLThread 1104
E/AndroidRuntime( 2238): java.lang.UnsatisfiedLinkError: Native method not found: com.wiagames.pacman.PacmanRenderer.nativeInit:()V
E/AndroidRuntime( 2238):    at com.wiagames.pacman.PacmanRenderer.nativeInit(Native Method)
E/AndroidRuntime( 2238):    at com.wiagames.pacman.PacmanRenderer.onSurfaceCreated(MainActivity.java:120)
E/AndroidRuntime( 2238):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
E/AndroidRuntime( 2238):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
W/ActivityManager(  306):   Force finishing activity com.wiagames.pacman/.MainActivity

main.c:
http://pastebin.com/GPexqwcv

MainActivity.java:
http://pastebin.com/yWfWpyNb

  • 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-11T04:39:07+00:00Added an answer on June 11, 2026 at 4:39 am

    To get the right linkage you might try declaring the JNI methods like so:

    extern "C"                                                                                                              
    JNIEXPORT void JNICALL Java_com_wiagames_pacman_PacmanRenderer_nativeInit(JNIEnv* env, jobject thiz)
    {
        ...
    }
    

    (Is it possible that you also changed from C to C++ in introducing Pacman.cpp to the project? That might explain why it stopped working.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got a simple problem. Here's my Android.mk: LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE
I have a simple Android.mk file: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) $(shell ($(LOCAL_PATH)/echo_test.sh))
What is wrong with my make file? Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS)
I am using NDK for my project... My android.mk file LOCAL_PATH:=$(call my-dir) include $(CLEAR_VARS)
Looks like it's possible, but my script produces odd results: LOCAL_PATH:= $(call my-dir) include
I'm trying to get my Android.mk file to optimize the binaries: LOCAL_PATH := $(call
I need to build some cross platform cpp files in my android mk file.
My app.cpp: #include app.h #include <EGL/egl.h> #include <EGL/eglext.h> void Java_com_geek_hello_FilterStack_nativeEglSetFenceAndWait(JNIEnv* env, jobject thiz) {
I am developing a mobile web application (for iPhone & Android) with a local
If I create an android database using SQLite it will be local, just for

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.