Closed XuxinDoubleWang closed 6 years ago
System information (version)
OpenCV => 3.1 Operating System / Platform => Ubuntu 16.04 Compiler => g++
Detailed description
Hello everyone, I want to compile opencv_contrib with GPU. I already install caffe successfully. I do the following steps:
$ cd $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D WITH_VTK=ON -D INSTALL_TESTS=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules .. $ make -j4
After make, I got the following errors:
Scanning dependencies of target example_cnn_3dobj_model_analysis [ 82%] Linking CXX executable ../../bin/example_cnn_3dobj_video CMakeFiles/example_cnn_3dobj_sphereview_data.dir/samples/sphereview_data.cpp.o: In function main': sphereview_data.cpp:(.text.startup.main+0x93d): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' sphereviewdata.cpp:(.text.startup.main+0x96e): undefined reference to cv::viz::Viz3d::setWindowSize(cv::Size const&)' sphereview_data.cpp:(.text.startup.main+0x9c4): undefined reference tocv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' sphereview_data.cpp:(.text.startup.main+0x9d7): undefined reference to cv::viz::Viz3d::spinOnce(int, bool)' sphereview_data.cpp:(.text.startup.main+0x9ef): undefined reference tocv::viz::Mesh::load(cv::String const&, int)' sphereview_data.cpp:(.text.startup.main+0x1018): undefined reference to cv::viz::makeCameraPose(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1237): undefined reference tocv::viz::makeTransformToGlobal(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1340): undefined reference to cv::viz::WMesh::WMesh(cv::viz::Mesh const&)' sphereview_data.cpp:(.text.startup.main+0x1747): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1886): undefined reference to cv::viz::Viz3d::setViewerPose(cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1899): undefined reference tocv::viz::Viz3d::saveScreenshot(cv::String const&)' sphereview_data.cpp:(.text.startup.main+0x1986): undefined reference to cv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x1dfd): undefined reference tocv::viz::WImage3D::WImage3D(cv::InputArray const&, cv::Size const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1fdf): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1ff3): undefined reference tocv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x20e4): undefined reference to cv::viz::Viz3d::~Viz3d()' sphereview_data.cpp:(.text.startup.main+0x2192): undefined reference tocv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x21a6): undefined reference to cv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x21d6): undefined reference tocv::viz::Viz3d::~Viz3d()' sphereview_data.cpp:(.text.startup.main+0x2461): undefined reference to cv::viz::Viz3d::~Viz3d()' [ 82%] Building CXX object modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_model_analysis.dir/samples/model_analysis.cpp.o collect2: error: ld returned 1 exit status modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/build.make:105: recipe for target 'bin/example_cnn_3dobj_sphereview_data' failed make[2]: [bin/example_cnn_3dobj_sphereview_data] Error 1 CMakeFiles/Makefile2:15036: recipe for target 'modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/all' failed make[1]: [modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/all] Error 2 make[1]: * Waiting for unfinished jobs.... [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/stitcher.cpp.o CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionstd::vector<cv::viz::WImageOverlay, std::allocatorcv::viz::WImageOverlay >::~vector()': video.cpp:(.text.ZNSt6vectorIN2cv3viz13WImageOverlayESaIS2_EED2Ev[ZNSt6vectorIN2cv3viz13WImageOverlayESaIS2_EED5Ev]+0x1c): undefined reference to cv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobjvideo.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x2d4b): undefined reference to cv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2d7b): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2dab): undefined reference to cv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2dde): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2e05): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x2e2c): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2e53): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x2e7a): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2ea1): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x3089): undefined reference tocv::viz::makeTransformToGlobal(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' video.cpp:(.text.startup.main+0x361e): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x3670): undefined reference tocv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x36c2): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x3ff0): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x403f): undefined reference to cv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x4082): undefined reference tocv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x40f0): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x41a1): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x426f): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x4291): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x42cb): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x4578): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x45c0): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4635): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4685): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x46f3): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4750): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x47be): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x480a): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4878): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x48d5): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x494d): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x49ae): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4a26): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4a84): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4b2b): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4bf6): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4c9f): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4d48): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point_ const&, int, cv::viz::Color const&)' CMakeFiles/example_cnn_3dobjvideo.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x4def): more undefined references tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x535f): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x540d): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x54ca): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x5587): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x5644): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x5701): more undefined references to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x6dc6): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x6efe): undefined reference tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x7032): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x716e): undefined reference tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x72aa): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x73e2): more undefined references tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x76a7): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x76fd): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7843): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7899): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7967): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x79bd): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7a8b): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7ae1): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7baf): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7c05): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7cd3): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7d28): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7e97): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x7eb3): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7ec2): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x7ff5): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x8012): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8021): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8154): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x8171): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8180): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x82b3): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x82d0): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x82df): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8412): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x842f): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x843e): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8571): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x858e): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x859d): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x877b): undefined reference tocv::viz::makeCameraPose(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' video.cpp:(.text.startup.main+0x8852): undefined reference to cv::viz::Viz3d::setViewerPose(cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8868): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x887e): undefined reference to cv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x8894): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x88b2): undefined reference to cv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88be): undefined reference tocv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88ca): undefined reference to cv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88d6): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88e2): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88ee): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88fa): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8906): undefined reference tocv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x8912): more undefined references to cv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x8a75): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8afb): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8b07): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8b13): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8d1a): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8d42): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8f80): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8f8c): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8f98): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8fa4): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8fd3): undefined reference to cv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x8fdf): more undefined references tocv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x9480): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x948c): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9498): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x954c): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x983e): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9852): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9b72): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9ba2): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9bd2): undefined reference tocv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x9c02): more undefined references to cv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x9eea): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9f1a): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9f4a): undefined reference to `cv::viz::Viz3d::~Viz3d()' collect2: error: ld returned 1 exit status modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/build.make:105: recipe for target 'bin/example_cnn_3dobj_video' failed make[2]: * [bin/example_cnn_3dobj_video] Error 1 CMakeFiles/Makefile2:15130: recipe for target 'modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/all' failed make[1]: [modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/all] Error 2 [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/timelapsers.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/exposure_compensate.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/util.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/blenders.cpp.o [ 82%] Linking CXX executable ../../bin/example_cnn_3dobj_model_analysis [ 82%] Built target example_cnn_3dobj_model_analysis [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/seam_finders.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/opencl_kernels_stitching.cpp.o [ 82%] Linking CXX shared library ../../lib/libopencv_stitching.so [ 82%] Built target opencv_stitching Makefile:160: recipe for target 'all' failed make: [all] Error 2
I am not sure what the problem is, but I think it may be link problem, like library libopencv_viz.so. I use $ pkg-config opencv --libs, it shows:
-L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_cudawarping -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -lopencv_dpm -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev
There is no libopencv_viz, but I am not sure how to install libopencv_viz. Any one has ideas? Thanks in advance.
This is not related to Caffe.
System information (version)
OpenCV => 3.1 Operating System / Platform => Ubuntu 16.04 Compiler => g++
Detailed description
Hello everyone, I want to compile opencv_contrib with GPU. I already install caffe successfully. I do the following steps:
$ cd
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D WITH_V4L=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D WITH_VTK=ON -D INSTALL_TESTS=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
$ make -j4
After make, I got the following errors:
Scanning dependencies of target example_cnn_3dobj_model_analysis [ 82%] Linking CXX executable ../../bin/example_cnn_3dobj_video CMakeFiles/example_cnn_3dobj_sphereview_data.dir/samples/sphereview_data.cpp.o: In function main': sphereview_data.cpp:(.text.startup.main+0x93d): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' sphereviewdata.cpp:(.text.startup.main+0x96e): undefined reference to cv::viz::Viz3d::setWindowSize(cv::Size const&)' sphereview_data.cpp:(.text.startup.main+0x9c4): undefined reference tocv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' sphereview_data.cpp:(.text.startup.main+0x9d7): undefined reference to cv::viz::Viz3d::spinOnce(int, bool)' sphereview_data.cpp:(.text.startup.main+0x9ef): undefined reference tocv::viz::Mesh::load(cv::String const&, int)' sphereview_data.cpp:(.text.startup.main+0x1018): undefined reference to cv::viz::makeCameraPose(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1237): undefined reference tocv::viz::makeTransformToGlobal(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1340): undefined reference to cv::viz::WMesh::WMesh(cv::viz::Mesh const&)' sphereview_data.cpp:(.text.startup.main+0x1747): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1886): undefined reference to cv::viz::Viz3d::setViewerPose(cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1899): undefined reference tocv::viz::Viz3d::saveScreenshot(cv::String const&)' sphereview_data.cpp:(.text.startup.main+0x1986): undefined reference to cv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x1dfd): undefined reference tocv::viz::WImage3D::WImage3D(cv::InputArray const&, cv::Size const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' sphereview_data.cpp:(.text.startup.main+0x1fdf): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' sphereview_data.cpp:(.text.startup.main+0x1ff3): undefined reference tocv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x20e4): undefined reference to cv::viz::Viz3d::~Viz3d()' sphereview_data.cpp:(.text.startup.main+0x2192): undefined reference tocv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x21a6): undefined reference to cv::viz::Widget::~Widget()' sphereview_data.cpp:(.text.startup.main+0x21d6): undefined reference tocv::viz::Viz3d::~Viz3d()' sphereview_data.cpp:(.text.startup.main+0x2461): undefined reference to cv::viz::Viz3d::~Viz3d()' [ 82%] Building CXX object modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_model_analysis.dir/samples/model_analysis.cpp.o collect2: error: ld returned 1 exit status modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/build.make:105: recipe for target 'bin/example_cnn_3dobj_sphereview_data' failed make[2]: [bin/example_cnn_3dobj_sphereview_data] Error 1 CMakeFiles/Makefile2:15036: recipe for target 'modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/all' failed make[1]: [modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_sphereview_data.dir/all] Error 2 make[1]: * Waiting for unfinished jobs.... [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/stitcher.cpp.o CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionstd::vector<cv::viz::WImageOverlay, std::allocatorcv::viz::WImageOverlay >::~vector()': video.cpp:(.text.ZNSt6vectorIN2cv3viz13WImageOverlayESaIS2_EED2Ev[ZNSt6vectorIN2cv3viz13WImageOverlayESaIS2_EED5Ev]+0x1c): undefined reference to cv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobjvideo.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x2d4b): undefined reference to cv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2d7b): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2dab): undefined reference to cv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x2dde): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2e05): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x2e2c): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2e53): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x2e7a): undefined reference tocv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x2ea1): undefined reference to cv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x3089): undefined reference tocv::viz::makeTransformToGlobal(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' video.cpp:(.text.startup.main+0x361e): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x3670): undefined reference tocv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x36c2): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x3ff0): undefined reference tocv::viz::Viz3d::Viz3d(cv::String const&)' video.cpp:(.text.startup.main+0x403f): undefined reference to cv::viz::Viz3d::setWindowSize(cv::Size const&)' video.cpp:(.text.startup.main+0x4082): undefined reference tocv::viz::Viz3d::setWindowPosition(cv::Point const&)' video.cpp:(.text.startup.main+0x40f0): undefined reference to cv::viz::Viz3d::setBackgroundColor(cv::viz::Color const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x41a1): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x426f): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x4291): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x42cb): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x4578): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x45c0): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4635): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4685): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x46f3): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4750): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x47be): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x480a): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4878): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x48d5): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x494d): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x49ae): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4a26): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x4a84): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4b2b): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4bf6): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4c9f): undefined reference tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x4d48): undefined reference to cv::viz::WText::WText(cv::String const&, cv::Point_ const&, int, cv::viz::Color const&)' CMakeFiles/example_cnn_3dobjvideo.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x4def): more undefined references tocv::viz::WText::WText(cv::String const&, cv::Point const&, int, cv::viz::Color const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x535f): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x540d): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x54ca): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x5587): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x5644): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x5701): more undefined references to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x6dc6): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x6efe): undefined reference tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x7032): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x716e): undefined reference tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' video.cpp:(.text.startup.main+0x72aa): undefined reference to cv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x73e2): more undefined references tocv::viz::WCloud::WCloud(cv::_InputArray const&, cv::viz::Color const&)' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x76a7): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x76fd): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7843): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7899): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7967): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x79bd): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7a8b): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7ae1): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7baf): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7c05): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7cd3): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7d28): undefined reference to cv::viz::Viz3d::setRenderingProperty(cv::String const&, int, double)' video.cpp:(.text.startup.main+0x7e97): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x7eb3): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x7ec2): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x7ff5): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x8012): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8021): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8154): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x8171): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8180): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x82b3): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x82d0): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x82df): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8412): undefined reference tocv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x842f): undefined reference to cv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x843e): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8571): undefined reference to cv::viz::WImageOverlay::WImageOverlay(cv::InputArray const&, cv::Rect const&)' video.cpp:(.text.startup.main+0x858e): undefined reference tocv::viz::Viz3d::showWidget(cv::String const&, cv::viz::Widget const&, cv::Affine3 const&)' video.cpp:(.text.startup.main+0x859d): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x877b): undefined reference tocv::viz::makeCameraPose(cv::Vec<double, 3> const&, cv::Vec<double, 3> const&, cv::Vec<double, 3> const&)' video.cpp:(.text.startup.main+0x8852): undefined reference to cv::viz::Viz3d::setViewerPose(cv::Affine3 const&)' video.cpp:(.text.startup.main+0x8868): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x887e): undefined reference to cv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x8894): undefined reference tocv::viz::Viz3d::spinOnce(int, bool)' video.cpp:(.text.startup.main+0x88b2): undefined reference to cv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88be): undefined reference tocv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88ca): undefined reference to cv::viz::Viz3d::removeAllWidgets()' video.cpp:(.text.startup.main+0x88d6): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88e2): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88ee): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x88fa): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8906): undefined reference tocv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x8912): more undefined references to cv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x8a75): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8afb): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8b07): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8b13): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8d1a): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8d42): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x8f80): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8f8c): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8f98): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8fa4): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x8fd3): undefined reference to cv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x8fdf): more undefined references tocv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In function main': video.cpp:(.text.startup.main+0x9480): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x948c): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9498): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x954c): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x983e): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9852): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9b72): undefined reference tocv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9ba2): undefined reference to cv::viz::Widget::~Widget()' video.cpp:(.text.startup.main+0x9bd2): undefined reference tocv::viz::Widget::~Widget()' CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o:video.cpp:(.text.startup.main+0x9c02): more undefined references to cv::viz::Widget::~Widget()' follow CMakeFiles/example_cnn_3dobj_video.dir/samples/video.cpp.o: In functionmain': video.cpp:(.text.startup.main+0x9eea): undefined reference to cv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9f1a): undefined reference tocv::viz::Viz3d::~Viz3d()' video.cpp:(.text.startup.main+0x9f4a): undefined reference to `cv::viz::Viz3d::~Viz3d()' collect2: error: ld returned 1 exit status modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/build.make:105: recipe for target 'bin/example_cnn_3dobj_video' failed make[2]: * [bin/example_cnn_3dobj_video] Error 1 CMakeFiles/Makefile2:15130: recipe for target 'modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/all' failed make[1]: [modules/cnn_3dobj/CMakeFiles/example_cnn_3dobj_video.dir/all] Error 2 [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/timelapsers.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/exposure_compensate.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/util.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/blenders.cpp.o [ 82%] Linking CXX executable ../../bin/example_cnn_3dobj_model_analysis [ 82%] Built target example_cnn_3dobj_model_analysis [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/src/seam_finders.cpp.o [ 82%] Building CXX object modules/stitching/CMakeFiles/opencv_stitching.dir/opencl_kernels_stitching.cpp.o [ 82%] Linking CXX shared library ../../lib/libopencv_stitching.so [ 82%] Built target opencv_stitching Makefile:160: recipe for target 'all' failed make: [all] Error 2
I am not sure what the problem is, but I think it may be link problem, like library libopencv_viz.so. I use $ pkg-config opencv --libs, it shows:
-L/usr/local/lib -lopencv_cudabgsegm -lopencv_cudaobjdetect -lopencv_cudastereo -lopencv_stitching -lopencv_cudafeatures2d -lopencv_superres -lopencv_cudacodec -lopencv_videostab -lopencv_cudaoptflow -lopencv_cudalegacy -lopencv_cudawarping -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_cvv -lopencv_dpm -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_face -lopencv_plot -lopencv_dnn -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_photo -lopencv_imgcodecs -lopencv_cudaimgproc -lopencv_cudafilters -lopencv_imgproc -lopencv_cudaarithm -lopencv_core -lopencv_cudev
There is no libopencv_viz, but I am not sure how to install libopencv_viz. Any one has ideas? Thanks in advance.