Is there any way to add a C/C++ library(.lib) file into an android project to use some functions of it? I'm familiar with simple JNI implementation and calling native C functions from java. I've a C++ project with a library file, source files and header files in it. How am i supposed to create Application.mk
to build .so
file so that i can call those C++ functions from java?
Asked
Active
Viewed 1,163 times
0

Reaz Murshed
- 23,691
- 13
- 78
- 98
-
http://stackoverflow.com/questions/5659068/jni-tutorial-for-android – 18446744073709551615 Jan 16 '14 at 06:45
-
http://blog.edwards-research.com/2012/04/tutorial-android-jni/ – 18446744073709551615 Jan 16 '14 at 06:45
-
Were you able to create a hello-world jni project? – 18446744073709551615 Jan 16 '14 at 06:46
-
yes I was able to create hello world jni project. – Reaz Murshed Jan 16 '14 at 07:09
-
then you need to specify the gcc command-line keys to compile with the library. – 18446744073709551615 Jan 16 '14 at 07:12
-
one of my .mk files has `LOCAL_LDLIBS := -llog` – 18446744073709551615 Jan 16 '14 at 07:13
-
Thanks for the comments. But I think my question is not clear enough for you. My bad. Anyway, I've a C++ project which is full functional and i want to use the same functions called from my java code by using the same library. – Reaz Murshed Jan 16 '14 at 07:23
-
is your .lib a windows file? For which architecture? – 18446744073709551615 Jan 16 '14 at 07:28
-
yes. Its an Object File Library. – Reaz Murshed Jan 16 '14 at 08:41
-
2You definitely cannot use binary files compiled for x86 windows on Android – 18446744073709551615 Jan 16 '14 at 09:16