seetaface / SeetaFaceEngine

Other
4.59k stars 1.78k forks source link

ubuntu14.04编译时出现LINK错误 #64

Open neoxiang opened 7 years ago

neoxiang commented 7 years ago

[ 95%] Linking CXX executable ./test_face_verification.bin [100%] Linking CXX executable ./test_face_recognizer.bin CMakeFiles/./test_face_verification.bin.dir/test_face_verification.cpp.o: In function main': test_face_verification.cpp:(.text.startup+0x16): undefined reference toseeta::FaceDetection::FaceDetection(char const_)' test_face_verification.cpp:(.text.startup+0x25): undefined reference to seeta::FaceDetection::SetMinFaceSize(int)' test_face_verification.cpp:(.text.startup+0x37): undefined reference toseeta::FaceDetection::SetScoreThresh(float)' test_face_verification.cpp:(.text.startup+0x49): undefined reference to seeta::FaceDetection::SetImagePyramidScaleFactor(float)' test_face_verification.cpp:(.text.startup+0x5d): undefined reference toseeta::FaceDetection::SetWindowStep(int, int)' test_faceverification.cpp:(.text.startup+0x6c): undefined reference to `seeta::FaceAlignment::FaceAlignment(char const)'

感觉是与检测和对齐编出来的库不匹配

neoxiang commented 7 years ago

这个问题出现在编译faceidentification的时候

octGitHub commented 7 years ago

楼主有解决了这个问题吗? 如果有的话,希望能够指点下下

我现在也是遇到类似的错误. 1.一开始提示找不到 face_detection.h face_alignment.h 2.两个头文件放进去以后编译提示 各种 undefined reference

实际上我是已经将之前两个模块的so链接到了 /usr/lib/目录下.

test_face_verification.cpp:(.text.startup+0x16): undefined reference to seeta::FaceDetection::FaceDetection(char const*)' test_face_verification.cpp:(.text.startup+0x25): undefined reference toseeta::FaceDetection::SetMinFaceSize(int)' test_face_verification.cpp:(.text.startup+0x37): undefined reference to seeta::FaceDetection::SetScoreThresh(float)' test_face_verification.cpp:(.text.startup+0x49): undefined reference toseeta::FaceDetection::SetImagePyramidScaleFactor(float)' test_face_verification.cpp:(.text.startup+0x5d): undefined reference to seeta::FaceDetection::SetWindowStep(int, int)' test_face_verification.cpp:(.text.startup+0x6c): undefined reference toseeta::FaceAlignment::FaceAlignment(char const_)' test_face_verification.cpp:(.text.startup+0x474): undefined reference to seeta::FaceDetection::Detect(seeta::ImageData const&)' test_face_verification.cpp:(.text.startup+0x4b3): undefined reference toseeta::FaceDetection::Detect(seeta::ImageData const&)' test_face_verification.cpp:(.text.startup+0x570): undefined reference to seeta::FaceAlignment::~FaceAlignment()' test_face_verification.cpp:(.text.startup+0x57a): undefined reference toseeta::FaceDetection::~FaceDetection()' test_faceverification.cpp:(.text.startup+0x5bb): undefined reference to `seeta::FaceAlignment::PointDetectLandmarks(seeta::ImageData, seeta::FaceInfo, seeta::FacialLandmark)' test_face_verification.cpp:(.text.startup+0x5e9): undefined reference to seeta::FaceAlignment::PointDetectLandmarks(seeta::ImageData, seeta::FaceInfo, seeta::FacialLandmark*)' test_face_verification.cpp:(.text.startup+0x986): undefined reference toseeta::FaceAlignment::~FaceAlignment()' test_face_verification.cpp:(.text.startup+0x990): undefined reference to `seeta::FaceDetection::~FaceDetection()'

ydar95 commented 7 years ago

可以尝试在 path/to/SeetaFaceEngine/FaceIdentification/src/test 目录下的 cmakelist.txt 中加入

aux_source_directory (. SRC_LIST)

message(${SRC_LIST})

add external libraries

find_package(OpenCV REQUIRED)

link_directories("/home/yd/SeetaFaceEngine/FaceIdentification/include")

enable_testing () foreach (f ${SRC_LIST}) string(REGEX REPLACE "[.]cpp" ".bin" BIN ${f}) add_executable(${BIN} ${f}) target_link_libraries(${BIN} viplnet ${OpenCV_LIBS}) target_link_libraries(${BIN} viplnet "/home/yd/SeetaFaceEngine/FaceIdentification/lib/libseeta_facedet_lib.so") # 这条 target_link_libraries(${BIN} viplnet "/home/yd/SeetaFaceEngine/FaceIdentification/lib/libseeta_fa_lib.so") #这条 endforeach ()

ydar95 commented 7 years ago

target_link_libraries(${BIN} viplnet "/home/yd/SeetaFaceEngine/FaceIdentification/lib/libseeta_facedet_lib.so") # 这条 target_link_libraries(${BIN} viplnet "/home/yd/SeetaFaceEngine/FaceIdentification/lib/libseeta_fa_lib.so") #这条

加入这两条,cmakelist 不会用,就写个绝对路径了,如果这样可以的化,请大家帮忙改写下

godisboy commented 7 years ago

我也遇到了这个问题,请问有解决的吗

neoxiang commented 7 years ago

编译通过了@ydar95,谢谢

godisboy commented 7 years ago

我这样修改后也编译通过了,但是没有生成seeta_fr_v1.0.bin文件 @neoxiang

seetaface commented 7 years ago

@octGitHub 需要先编译人脸检测(detection)和人脸对齐(alignment)的库,才能成功编译test_face_verification.cpp这个文件

seetaface commented 7 years ago

@godisboy 这个文件是模型文件,在“FaceIdentification\model”目录下有提供。下载完解压即可得到