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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:50:29+00:00 2026-06-14T10:50:29+00:00

I’m developing an app with native part which uses embedded OpenCV to extract frames

  • 0

I’m developing an app with native part which uses embedded OpenCV to extract frames from video file. So far I’m getting this error:

.../jni/ocv.c:12: undefined reference to `cvCreateFileCapture'

My Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := ocv
LOCAL_SRC_FILES := ocv.c

include $(BUILD_SHARED_LIBRARY)

Application.mk:

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

ocv.c:

#include <string.h>
#include <jni.h>
#include <stdio.h>
#include <dlfcn.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>

jstring Java_com_ice_salvador_MainActivity_invokeNativeFunction(JNIEnv* env, jobject javaThis) {
    IplImage* currFrame = 0;
    CvCapture* cap = 0;

    cap = cvCaptureFromFile("/mnt/sdcard/vvv.3gp"); //test video

    return (*env)->NewStringUTF(env, "Hello from native code!");
}

I’m using OpenCV-2.4.3-android-sdk, Android NDK r8b, Eclipse Juno, Windows.

IplImage, CvCapture gets resolved and the code compiles if I remove the line with cvCaptureFromFile – so I assume I’m on the right way. I’m new to JNI and OpenCV. Appreciate your help! Thanks.

  • 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-14T10:50:30+00:00Added an answer on June 14, 2026 at 10:50 am

    Not to leave my own question unanswered..

    1) I’ve changed Android.mk to include OpenCV.mk from SDK and to include .so lib into the build:

    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    include c:\dev\OpenCV-2.4.3-android-sdk\sdk\native\jni\OpenCV.mk
    
    LOCAL_MODULE    := ocv
    LOCAL_SRC_FILES := ocv.c
    LOCAL_LDLIBS += -Lc:\dev\OpenCV-2.4.3-android-sdk\sdk\native\libs\armeabi
    
    include $(BUILD_SHARED_LIBRARY)
    
    #LOCAL_PATH := /home/spatialite/jni
    include $(CLEAR_VARS)
    LOCAL_MODULE := libopencv_java
    LOCAL_SRC_FILES := libopencv_java.so
    include $(PREBUILT_SHARED_LIBRARY)
    

    2) Copied libopencv_java.so to jni/ folder.

    3) Changed java code to:

    static {
      System.loadLibrary("opencv_java");
      System.loadLibrary("ocv");
    }
    

    And the error has gone.

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I want use html5's new tag to play a wav file (currently only supported

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.