These days are quite troublesome. For RTSP server, we need to port live555 to Android. The common practice is to write an android program. MK, put it under the android source code tree, mm, you can, but I have always had a bunch of errors, and I compiled it under a separate ndk, it turned out to be normal, just in idle time, let's take a look at the compilation error prompts. I didn't find the C ++ libraries. The Compiler automatically adds these libraries to the ndk, in the android source code tree, you must add the following:
Local_ldflags + = $ (local_path )/.. /.. /prebuilts/ndk/android-ndk-r7/sources/cxx-STL/gnu-libstdc ++/libs/armeabi-v7a/libsupc ++. A \
$ (Local_path)/.../prebuilts/ndk/android-ndk-r7/sources/cxx-STL/gnu-libstdc ++/libs/armeabi-v7a/libgnustl_static.a
My live555 directory is under/live555/JNI/, So I need two ../
$ (Local_path) is a very important thing. It tells the compiler the path of the library to be linked, which is relative to the current path.
I am confused about a lot of errors reported by the compiler. I looked at the following and searched on the net. The answer was quite different. What did I say about compiling C ++ code with GCC, in fact, Android knows to compile with corresponding tools during compilation. It seems that the cause of compilation errors should start from the first few, rather than from the last few errors. Sometimes these errors are falsely reported. I have solved the first few errors, and all the subsequent errors are gone.
The difference between local_ldflags and local_ldlibs is that the latter looks like this: "-L $ (local_path )/.. /.. /prebuilts/ndk/android-ndk-r7/sources/cxx-STL/gnu-libstdc ++/libs/armeabi-v7a-lsupc ++"