[Solved] OpenCv 3 and link problem
eigen_faces.cpp:-1: error: undefined reference to cv::LDA::subspaceProject(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&)'**
eigen_faces.cpp:-1: error: **undefined reference to
cv::Algorithm::Algorithm()'
I have already linked all libraries, see above: LIBS += ../../opencv-3.0.0/lib/libopencv_adas300.a LIBS += ../../opencv-3.0.0/lib/libopencv_aruco300.a LIBS += ../../opencv-3.0.0/lib/libopencv_aruco_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_bgsegm300.a LIBS += ../../opencv-3.0.0/lib/libopencv_bgsegm_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_bioinspired300.a LIBS += ../../opencv-3.0.0/lib/libopencv_bioinspired_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_calib3d300.a LIBS += ../../opencv-3.0.0/lib/libopencv_calib3d_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_ccalib300.a LIBS += ../../opencv-3.0.0/lib/libopencv_ccalib_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_core300.a LIBS += ../../opencv-3.0.0/lib/libopencv_core_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_datasets300.a LIBS += ../../opencv-3.0.0/lib/libopencv_dnn300.a LIBS += ../../opencv-3.0.0/lib/libopencv_dnn_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_dpm300.a LIBS += ../../opencv-3.0.0/lib/libopencv_dpm_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_face300.a LIBS += ../../opencv-3.0.0/lib/libopencv_face_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_features2d300.a LIBS += ../../opencv-3.0.0/lib/libopencv_features2d_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_flann300.a LIBS += ../../opencv-3.0.0/lib/libopencv_flann_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_hal300.a LIBS += ../../opencv-3.0.0/lib/libopencv_hal_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_highgui300.a LIBS += ../../opencv-3.0.0/lib/libopencv_highgui_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_imgcodecs300.a LIBS += ../../opencv-3.0.0/lib/libopencv_imgcodecs_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_imgproc300.a LIBS += ../../opencv-3.0.0/lib/libopencv_imgproc_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_line_descriptor300.a LIBS += ../../opencv-3.0.0/lib/libopencv_line_descriptor_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_ml300.a LIBS += ../../opencv-3.0.0/lib/libopencv_ml_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_objdetect300.a LIBS += ../../opencv-3.0.0/lib/libopencv_objdetect_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_optflow300.a LIBS += ../../opencv-3.0.0/lib/libopencv_optflow_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_photo300.a LIBS += ../../opencv-3.0.0/lib/libopencv_photo_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_reg300.a LIBS += ../../opencv-3.0.0/lib/libopencv_reg_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_rgbd300.a LIBS += ../../opencv-3.0.0/lib/libopencv_rgbd_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_saliency300.a LIBS += ../../opencv-3.0.0/lib/libopencv_saliency_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_shape300.a LIBS += ../../opencv-3.0.0/lib/libopencv_shape_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_stereo300.a LIBS += ../../opencv-3.0.0/lib/libopencv_stereo_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_stitching300.a LIBS += ../../opencv-3.0.0/lib/libopencv_stitching_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_structured_light300.a LIBS += ../../opencv-3.0.0/lib/libopencv_structured_light_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_superres300.a LIBS += ../../opencv-3.0.0/lib/libopencv_superres_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_surface_matching300.a LIBS += ../../opencv-3.0.0/lib/libopencv_surface_matching_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_text300.a LIBS += ../../opencv-3.0.0/lib/libopencv_text_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_tracking300.a LIBS += ../../opencv-3.0.0/lib/libopencv_tracking_pch_dephelp.a LIBS += ../../opencv-3.0.0/lib/libopencv_ts300.a LIBS += ../../opencv-3.0.0/lib/libopencv_ts_pch_dephelp.a LIBS ...
are those static libs ? in that case, the order matters, e.g. if face depends on core, core has to go after face
mingw / gcc will never complain about non-existing libs, or wrong path
-L /path/to/libs
and-lopencv_something
(without .a or similar)In desperation I have linked all libraries. I have tried to change the rows order but nothing. Each time I have obtained a different linker error. On Linux the same order works perfectly.
are those static libs ?
As static because if I use -DBUILD_SHARED_LIBS=ON I obtain ar error at cmake time.
then, linking order definitely matters.
(also, please do not make answers, when it should be a comment..)
Try to use cmake to build your application, please take a look at the example project included in OpenCV: https://github.com/Itseez/opencv/tree...