In recent development, we need to do some processing and linear technology of the picture, then use the Ceres Solver. How to integrate Ceres Solver into Android? The official website gave a solution, concise and clear: download The android ndk version r9d or later. Run ndk-build from inside The jni directory. Use The libceres.a that get created. (meaning: Download the NDK r9d or later and go to the JNI directory where you downloaded the latest Ceres-solver package and run Ndk-build LIBCERES.A static package) steps as follows: 1, add NDK environment variables, do not understand the installation tutorial can be searched. 2, run = "cmd, open the Command Line window, CD into the download Ceres-solver package of JNI directory, run Ndk-build: jni/android.mk:80: * * * Ceres requires NDK version r9d or GR Eater. Stop. Error! Looking at the Android.mk 80 line, you can tell that it is the version of the current NDK and runs the shell script (assert_ndk_version.sh) under the JNI directory. But I find my ndk is up to date, why also reported this anomaly? To view the current NDK version, click here. Looking carefully at the contents of the assert_ndk_version.sh file, it was found that it was looking for an NDK root directory called RELEASE. TXT file, but we didn't. So create a new one, and then add r14b (64-bit) (replaced with your NDK version) on the MAC system to run through, and on Windows will continue to report the above error, because Windows cannot run the shell script directly. Directly when, android.mk 79-81 lines with # comment out. The LIBCERES.A static file is then compiled. But this compiled static file, in use, still will error, open Ceres-solver package of JNI directory under the Application.mk file, you can see: App_cppflags +=-fno-exceptionsapp_cppflags + =-fno-rttiapp_stl: = c++_static
name |
description; |
features |
libstdc++ (default) |
default Minimum system C + + Runtime library. |
does not work with |
gabi++_static |
gabi++ Runtime (static). |
C + + exceptions and RTTI |
gabi++_shared |
gabi++ Runtime (shared). |
C + + exceptions and RTTI |
stlport_static |
stlport Runtime (static). |
C + + exceptions and RTTI; standard library |
stlport_shared |
stlport Runtime (shared). |
C + + exceptions and RTTI; standard library |
gnustl_static |
GNU STL (Static). |
C + + exceptions and RTTI; standard library |
gnustl_shared |
GNU STL (shared). |
C + + exceptions and RTTI; standard library |
c++_static |
LLVM libc++ Runtime (static). |
C + + exceptions and RTTI; standard library |
c++_shared |
LLVM libc++ Runtime (shared). |
C + + exceptions and RTTI; standard library |
C++_static we usually use less (because I am not familiar with C + +), so change the above three parameters to: app_stl: = gnustl_staticapp_cppflags + =-frttiapp_cppflags + +- Fexceptions then ndk-build to get a correct libceres.a static file. (Welcome message discussion)
I compiled the Ceres-solver project Http://pan.baidu.com/s/1bo3ENoj
Ceres Solver for Android