gv22ga / dlib-face-recognition-android

Android app to demo dlib face recognition
MIT License
148 stars 50 forks source link

Point out modification in dlib for compiling without c++11 (caused by Opencv & C++ 11 Confliction) #13

Open likelovez opened 6 years ago

likelovez commented 6 years ago

According to my experiment, when i change your modified dlib into offical dlib v19.13 there are several bug such as: round not in namespace std, to_string not in namespace std. These bugs is totally related to C++11 linker or confliction. And then, i modify APP_STL := c++_shared to generate a libc++_shared.so for solve the problem above, and the compile results still failed with error:

clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: [obj/local/arm64-v8a/libandroid_dlib.so] Error 1 make: Waiting for unfinished jobs.... clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [obj/local/armeabi-v7a/libandroid_dlib.so] Error 1 And several error of undefined reference to ...

So can you point out your modification for me to compile newer dlib for android ?

Thanks in advance!

gv22ga commented 6 years ago

I made some small changes in these files dlib/dlib/serialize.h, dlib/dlib/dnn/layers.h, dlib/dlib/geometry/rectangle.h, dlib/dlib/image_transforms/interpolation.h, dlib/dlib/dnn/loss.h, dlib/dlib/statistics/running_gradient.h and dlib/dlib/global_optimization/global_function_search.cpp

I don't exactly remember but I wrote some workaround for c++11 functions like std::round and std::to_string.

I used dlib 19.9. If you use some other dlib version, you may need to make changes in more files.

likelovez commented 6 years ago

Thanks for your response, I already know that you are using dlib 19.9 based on Dlib' Cmakelist.txt. This is totally caused by c++11 functions.