Can't able to run facerec_fisherface.cpp

asked 2016-01-09 03:45:57 -0600

Hi, I am new to OpenCV. I am working on gender classification, so i started with sample code. I was trying to execute of facerec_fisherfaces.cpp sample program in MinGW but unfortunately i am getting below error message. please help us to solve this.

C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x5c)
    : undefined reference to `cv::noArray()'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x6e)
    : undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0xa7)
    : undefined reference to `cv::normalize(cv::_InputArray const&, cv::_OutputArray
     const&, double, double, int, int, cv::_InputArray const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0xae)
    : undefined reference to `cv::noArray()'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0xc0)
    : undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0xf9)
    : undefined reference to `cv::normalize(cv::_InputArray const&, cv::_OutputArray
     const&, double, double, int, int, cv::_InputArray const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x10b
    ): undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x11e
    ): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x25e
    ): undefined reference to `cv::Exception::Exception(int, std::string const&, std
    ::string const&, std::string const&, int)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x26c
    ): undefined reference to `cv::error(cv::Exception const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x276
    ): undefined reference to `cv::Exception::~Exception()'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x37d
    ): undefined reference to `cv::imread(std::string const&, int)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x44d
    ): undefined reference to `cv::Exception::~Exception()'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x792
    ): undefined reference to `cv::Exception::Exception(int, std::string const&, std
    ::string const&, std::string const&, int)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x7a3
    ): undefined reference to `cv::error(cv::Exception const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x7b0
    ): undefined reference to `cv::Exception::~Exception()'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x8a6
    ): undefined reference to `cv::createFisherFaceRecognizer(int, double)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x8eb
    ): undefined reference to `cv::_InputArray::_InputArray(std::vector<cv::Mat, std
    ::allocator<cv::Mat> > const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x934
    ): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x96e
    ): undefined reference to `cv::format(char const*, ...)'
    C:\Users\raja\AppData\Local\Temp\ccKzzFDw.o:facerec_fisherfaces.cpp:(.text+0x9ec
    ): undefined reference to `cv::Algorithm::getMat(std::string const ...
(more)
edit retag flag offensive close merge delete

Comments

1
  • which opencv version is it ?
  • are you really trying to build for android with mingw ? (you'd rather need the android ndk toolchain then)
  • if it's for a pc instead, did you build the opencv libs for mingw ? (you can't use the prebuild vs ones)
  • did you link any opencv libs ? (it does not look so)
berak gravatar imageberak ( 2016-01-09 03:56:03 -0600 )edit
  • opencv version 2.4.9

  • yes in future i want to build application in android using opencv, but right now i am running the sample code(facerec_fisherfaces.cpp) using include header files(opencv2 folder files) in MinGW(g++ compiler).

  • No .so file used.

  • First of all i want to see how fisherface algorithm output is coming, So i followed steps from opencv docs and started executinf cpp files using MinGW.

  • If i am doing wrong way please correct me to where to start.(basically i am android developer).

raj_kumar gravatar imageraj_kumar ( 2016-01-09 05:12:40 -0600 )edit
2

OpenCV cannot run simply on header files, so there is your problem. You need to build OpenCV with MinGW compilers and link to the corresponding .so files before it will even work. Your system only knows which functions there are, but has no idea where to look for the implementation of it.

StevenPuttemans gravatar imageStevenPuttemans ( 2016-01-11 02:59:57 -0600 )edit