error LNK2019 in visual studio

asked 2016-11-15 10:21:10 -0600

eisa gravatar image

HI, I'm new in VS2015 and in Opencv_contrib. I'm trying to make a face recognition program using the cv::face::FaceRecognizer. In fase of compilation it gives me the following error:

1>FaceRecognition.obj : error LNK2019: unresolved external symbol "public: int __cdecl cv::face::FaceRecognizer::predict(class cv::_InputArray const &)const " (?predict@FaceRecognizer@face@cv@@QEBAHAEBV_InputArray@3@@Z) unresolved in function main 1>FaceRecognition.obj : error LNK2019: unresolved external symbol "struct cv::Ptr<class cv::face::basicfacerecognizer=""> __cdecl cv::face::createEigenFaceRecognizer(int,double)" (?createEigenFaceRecognizer@face@cv@@YA?AU?$Ptr@VBasicFaceRecognizer@face@cv@@@2@HN@Z) unresolved in funciont main

I know there is a problem this the linker and probably I fortgot to include some file.lib but I do not know which. Please, someone can help me?

edit retag flag offensive close merge delete


probably opencv_face310.lib

berak gravatar imageberak ( 2016-11-15 10:44:23 -0600 )edit

It dosen't work. In the folder of opencv_contrib there isn't any file.lib. It's possible?

eisa gravatar imageeisa ( 2016-11-15 11:29:06 -0600 )edit

how do you build opencv?

LBerger gravatar imageLBerger ( 2016-11-15 13:39:51 -0600 )edit

I downloaded the and unpack it. Is not the correct way?

eisa gravatar imageeisa ( 2016-11-15 14:15:11 -0600 )edit

and have you build opencv_contrib using this

LBerger gravatar imageLBerger ( 2016-11-15 14:19:29 -0600 )edit

I try but cmake give me an error:

The C compiler identification is unknown The CXX compiler identification is unknown CMake Error in CMakeLists.txt: No CMAKE_C_COMPILER could be found.

CMake Error in CMakeLists.txt: No CMAKE_CXX_COMPILER could be found.

CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as

cmake_minimum_required(VERSION 3.7)
eisa gravatar imageeisa ( 2016-11-16 01:22:37 -0600 )edit

should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run "cmake --help-policy CMP0000". This warning is for project developers. Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred! See also "C:/Users/elisa/Documents/opencv/build/include/opencv2/CMakeFiles/CMakeOutput.log". See also "C:/Users/elisa/Documents/opencv/build/include/opencv2/CMakeFiles/CMakeError.log".

eisa gravatar imageeisa ( 2016-11-16 01:22:58 -0600 )edit

Don't forget to delete CMakeCache.txt and don't use VS 2015 generator use VS 14 2015 win 64. With Cmake 3.7.0-rc2 it should work

LBerger gravatar imageLBerger ( 2016-11-16 01:30:18 -0600 )edit

Ok! Thank you very much!!

eisa gravatar imageeisa ( 2016-11-16 02:28:00 -0600 )edit