0

I'm developing an iOS application with latest SDK that it will use OpenCV.

This app is a migration from an Android app, and I will use all it C++ files on my iOS project.

On C++ files I have functions signatures like this one:

myFunction(JNIEnv * jenv, jclass jobj, jint width, jint height,jintArray leftDetectionRectArray, jintArray rightDetectionRectArray )

Can I use these C++ files without any changes on my iOS code? or do you I have to do some changes on them?

What do you recommend me?

1
  • 1
    Looks like you are using JNI, so there will have to be some changes before it will work under iOS. Commented Mar 5, 2013 at 10:26

1 Answer 1

1

You cannot use those C/C++ files in you iOS code without modification.

The part using JNI may only be an interface to your real code (in pure C/C++), in which case you can remove it and either directly use the C/C++ code or create an objective-C interface.

The JNI functions are not and will not be defined on iOS as there is no Java Virtual Machine on iOS-based device (at least not in any official release).

Sign up to request clarification or add additional context in comments.

2 Comments

I know that. I'm going to use only .cpp and .hpp files. Are you saying that I have to modify .cpp files to add new functions' signatures?
And you have to remove all refenrece to jni objects, types, and so on (or make a typedef for some tyes e.g. jint, as defined in jni.h)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.