err
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `align_mean(cv::Mat, cv::Rect_<int>, float, float, float, float)': main_stateEstimation.cpp:(.text+0x4a8): multiple definition of `align_mean(cv::Mat, cv::Rect_<int>, float, float, float, float)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x340): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `align_mean(cv::Mat, cv::Mat)': main_stateEstimation.cpp:(.text+0x8b0): multiple definition of `align_mean(cv::Mat, cv::Mat)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x1710): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `perturb(cv::Rect_<int>)': main_stateEstimation.cpp:(.text+0xf40): multiple definition of `perturb(cv::Rect_<int>)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x2e50): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main_stateEstimation.cpp:(.text+0x1068): multiple definition of `trim(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x2f78): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `replace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main_stateEstimation.cpp:(.text+0x11a8): multiple definition of `replace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x30b8): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `save_ImageLabels(std::vector<ImageLabel, std::allocator<ImageLabel> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': main_stateEstimation.cpp:(.text+0xc3a0): multiple definition of `save_ImageLabels(std::vector<ImageLabel, std::allocator<ImageLabel> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x7070): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main_stateEstimation.cpp:(.text+0xd0e0): multiple definition of `split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x7ca8): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `ReadLabelsFromFile(std::vector<ImageLabel, std::allocator<ImageLabel> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': main_stateEstimation.cpp:(.text+0xd3c0): multiple definition of `ReadLabelsFromFile(std::vector<ImageLabel, std::allocator<ImageLabel> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x8030): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x8f0): multiple definition of `trainFilePath' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x608): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o: In function `load_ImageLabels(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<ImageLabel, std::allocator<ImageLabel> >&)': main_stateEstimation.cpp:(.text+0xe9e8): multiple definition of `load_ImageLabels(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<ImageLabel, std::allocator<ImageLabel> >&)' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:stateEstimation.cpp:(.text+0x91a0): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x308): multiple definition of `estimateHeadPoseMat' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x20): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x528): multiple definition of `extern_point_indexs' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x240): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x560): multiple definition of `extern_point_Length' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x278): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x568): multiple definition of `eyes_indexs' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x280): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x578): multiple definition of `IteraLandmarkIndex5' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x290): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x5c8): multiple definition of `LandmarkLength5' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x2e0): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x5d0): multiple definition of `IteraLandmarkIndex4' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x2e8): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x620): multiple definition of `LandmarkLength4' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x338): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x628): multiple definition of `IteraLandmarkIndex3' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x340): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x658): multiple definition of `LandmarkLength3' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x370): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x660): multiple definition of `IteraLandmarkIndex2' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x378): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x690): multiple definition of `LandmarkLength2' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x3a8): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x698): multiple definition of `IteraLandmarkIndex1' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x3b0): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x6c8): multiple definition of `LandmarkLength1' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x3e0): first defined here CMakeFiles/dsm.dir/src/main_stateEstimation.cpp.o:(.data+0x6d0): multiple definition of `mean_norm_shape' CMakeFiles/dsm.dir/src/stateEstimation.cpp.o:(.data+0x3e8): first defined here collect2: error: ld returned 1 exit status CMakeFiles/dsm.dir/build.make:172: recipe for target '../lib/libdsm.so' failed make[2]: *** [../lib/libdsm.so] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dsm.dir/all' failed make[1]: *** [CMakeFiles/dsm.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2
ref:
1. multiple definition of `xxxx`问题解决及其原理;
2. 解决multiple definition of的方法;
end