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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:12:33+00:00 2026-06-05T07:12:33+00:00

I with success compile library LibXtract to shared object libxtract.so and want to use

  • 0

I with success compile library LibXtract to shared object libxtract.so and want to use is in second project.

In mention project I try to compile it on simple function:

#include <com_androidnative1_NativeClass.h>
#include <android/log.h>
#include "libxtract.h"

JNIEXPORT void JNICALL Java_com_androidnative1_NativeClass_showText
(JNIEnv *env, jclass clazz)
{

    float mean = 0, vector[] = {.1, .2, .3, .4, -.5, -.4, -.3, -.2, -.1}, spectrum[10];
    int n, N = 9;
    float argf[4];

    argf[0] = 8000.f;
    argf[1] = XTRACT_MAGNITUDE_SPECTRUM;
    argf[2] = 0.f;
    argf[3] = 0.f;

    xtract[XTRACT_MEAN]((void *)&vector, N, 0, (void *)&mean);
    __android_log_print(ANDROID_LOG_DEBUG, "LIbXtract", "Button pushe2");
}

I have flat structure:

  • jni/com_androidnative1_NativeClass.c
  • jni/com_androidnative1_NativeClass.hjni/libxtract.h
  • jni/other *.h files from libxtract interface
  • jni/Android.mk
  • jni/Applicatoin.mk

library libxtract.so I put in mainproject/lib folder

my Android.mk file looks like:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := com_androidnative1_NativeClass.c 
LOCAL_MODULE := com_androidnative1_NativeClass
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/
LOCAL_LDLIBS += -llog
LOCAL_SHARE_LIBRARIES := libxtract
NDK_MODULE_PATH += $(LOCAL_PATH)/../lib/
include $(BUILD_SHARED_LIBRARY)

and I still got error:

Compile thumb  : com_androidnative1_NativeClass <= com_androidnative1_NativeClass.c
SharedLibrary  : libcom_androidnative1_NativeClass.so./obj/local/armeabi/objs/com_androidnative1_NativeClass/com_androidnative1_Nativ    eClass.o: In function `Java_com_androidnative1_NativeClass_showText':
/home/jack/Projects/AndroidNative1/jni/com_androidnative1_NativeClass.c:20: undefined reference to `xtract'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libcom_androidnative1_NativeClass.so] Error 1

Code came form example of LibXtract and under C++ compile without problems, any ideas?

  • 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-05T07:12:34+00:00Added an answer on June 5, 2026 at 7:12 am

    Your Android make file should be …

    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LIB_PATH := $(LOCAL_PATH)/../lib
    LOCAL_SRC_FILES := com_androidnative1_NativeClass.c 
    LOCAL_MODULE := com_androidnative1_NativeClass
    LOCAL_LDLIBS += -llog
    


    LOCAL_LDLIBS += $(LIB_PATH) -lxtract

    LOCAL_SHARE_LIBRARIES := libxtract
    include $(BUILD_SHARED_LIBRARY)
    

    Try this make file in your second project, and you can successfully build your code without having any error.

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

Sidebar

Related Questions

... success: function (reqCode) { if (reqCode['error_code'] == 1) { //Generiere Tabelle $(.done).html( '<p
Inside a $.getJSON success function, I first trigger another element's click event: $('#' +
I tried with no success: webBrowser1.Document.ExecCommand(alert('Hello World!'), true, null); also tried: private void webBrowser1_DocumentCompleted(object
private void ExecuteCommand(Expression<Func<bool>> command) { bool success = command.Compile().Invoke(); } private void Test() {
I use this method to compile C++ file in VS. But even i provide
I get the following warning when I try to compile the code: exercise6.c:32:14: warning:
i'm trying to compile a c program using the berkeley db library (libdb) on
I would like to use the new Bootstrap library from Twitter for an external
You can use e.g. JUnit to test the functionality of your library, but how
I am completely newbie in wxWidget and want to learn about this library. I've

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.