Closed rahulr4 closed 6 years ago
Please read the build instructions carefully: https://github.com/Lauszus/FaceRecognitionApp#build-instructions and take a look at all the old issues: https://github.com/Lauszus/FaceRecognitionApp/issues?q=is%3Aissue+is%3Aclosed.
Anyway, it looks like you have not cloned the submodules, so please run:
git submodule update --init --recursive
All the below errors are coming after successfully compilation by following the instructions :
/Rahul/Face/FaceRecognitionApp/app/src/main/cpp/FaceRecognitionLib/OpenCV-android-sdk_2/sdk/native/jni/include/opencv2/core/eigen.hpp
Error:(151) undefined reference to 'cv::transpose(cv::_InputArray const&, cv::_OutputArray const&)'
Error:(154) undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
Error:(155) undefined reference to 'cv::transpose(cv::_InputArray const&, cv::_OutputArray const&)'
Error:(158) undefined reference to 'cv::Mat::t() const'
Error:(158) undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
Error:(164) undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
Error:(192) undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
Error:(200) undefined reference to 'cv::transpose(cv::_InputArray const&, cv::_OutputArray const&)'
Error:(202) undefined reference to 'cv::Mat::t() const'
Error:(202) undefined reference to 'cv::Mat::convertTo(cv::_OutputArray const&, int, double, double) const'
/Rahul/Face/FaceRecognitionApp/app/src/main/cpp/FaceRecognitionLib/OpenCV-android-sdk_2/sdk/native/jni/include/opencv2/core/cvstd.hpp
Error:(622) undefined reference to 'cv::String::allocate(unsigned int)'
Error:(664) undefined reference to 'cv::String::deallocate()'
/Rahul/Face/FaceRecognitionApp/app/src/main/cpp/FaceRecognitionLib/OpenCV-android-sdk_2/sdk/native/jni/include/opencv2/core/mat.inl.hpp
Error:(431) undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
Error:(447) undefined reference to 'cv::error(int, cv::String const&, char const*, char const*, int)'
Error:(592) undefined reference to 'cv::fastFree(void*)'
Error:(704) undefined reference to 'cv::Mat::deallocate()'
Error:error: linker command failed with exit code 1 (use -v to see invocation)
Hmm which versions of OpenCV and Eigen have you downloaded?
The version mentioned in instructions - OpenCV 3.2.0 and Eigen3 3.3.3. Also I am using mac so these libraries were not being read inside the code so i added these libraries inside the FaceRecognitionLib folder and added the lines in Android.mk.
LOCAL_C_INCLUDES += $(LOCAL_PATH)/FaceRecognitionLib/eigen-eigen-67e894c6cd8f
LOCAL_C_INCLUDES += $(LOCAL_PATH)/FaceRecognitionLib/OpenCV-android-sdk_2/sdk/native/jni/include
any update ?
@rahulr4 you should not include the the OpenCV headers. You should not add anything to the Makefile, simply just hardcode the paths if you are having troubles with setting the environmental variables. For instance it could be hardcoded like so:
include /Users/rahulr4/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_C_INCLUDES += /Users/rahulr4/eigen-eigen-67e894c6cd8f
@rahulr4 I my case I have used hard coded path as below
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
OPENCV_INSTALL_MODULES := on
include /home/demo/Workspace_Android_Studio/Samples/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
LOCAL_MODULE := face-lib
LOCAL_SRC_FILES += $(LOCAL_PATH)/face-lib.cpp $(LOCAL_PATH)/FaceRecognitionLib/Facebase.cpp
LOCAL_SRC_FILES += $(LOCAL_PATH)/FaceRecognitionLib/Eigenfaces.cpp $(LOCAL_PATH)/FaceRecognitionLib/Fisherfaces.cpp
LOCAL_SRC_FILES += $(LOCAL_PATH)/FaceRecognitionLib/PCA.cpp $(LOCAL_PATH)/FaceRecognitionLib/LDA.cpp
LOCAL_C_INCLUDES += $(EIGEN3_DIR) $(LOCAL_PATH)/FaceRecognitionLib/RedSVD/include
LOCAL_LDLIBS += -llog -ldl
LOCAL_CPPFLAGS += -std=gnu++11 -frtti -fexceptions
include $(BUILD_SHARED_LIBRARY)
Please try to hardcode EIGEN3_DIR
as well i.e:
LOCAL_C_INCLUDES += /Users/rahulr4/eigen-eigen-67e894c6cd8f $(LOCAL_PATH)/FaceRecognitionLib/RedSVD/include
Closing this issue, as the project build fine when following the build instructions.
I have now setup a Travis build to automatically upload a zip directory of the project including all the dependencies. This should make much easier for people to compile the project.
You can try it out at the following link: https://github.com/Lauszus/FaceRecognitionApp/releases/download/1.2.1/FaceRecognitionApp-1.2.1.zip.
Getting the below error