<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div style="">
<div id="divRpF400204" style="color: rgb(0, 0, 0); font-family: "Times New Roman"; font-size: 16px; direction: ltr;">
<span style="font-family: Tahoma; font-size: 10pt;">Hi all,</span></div>
<div style="">
<div style="direction: ltr;">
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">I'm trying to compile  the following code using clang++:</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><a href="https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp" target="_blank" rel="noopener noreferrer">https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/ImgProc/Morphology_1.cpp</a></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">With g++ I don't have problem I just did:</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px">g++ Morphology_1.cpp -I /workspace/opencv/modules/core/include/ -I /workspace/opencv/modules/imgproc/include/ -I /workspace/opencv/modules/core/include/
 -I /workspace/opencv/include/opencv2/ -I /workspace/opencv/build/ -I /workspace/opencv/modules/highgui/include/  -I /workspace/opencv/modules/imgcodecs/include/ -I /workspace/opencv/modules/videoio/include/ -L /workspace/opencv/build/lib/ -std=c++11 -o Morphology
 -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_imgcodecs</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px">cp ../../../data/LinuxLogo.jpg LinuxLogo.jpg</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px">sudo ldconfig -v</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px">Using the same compilation flags I got this error (clang++):</span></div>
<div style=""><span style="font-size: 13.3333px;">/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/cstddef:51:11: error: no member named 'max_align_t' in the global namespace</span></div>
<div style=""><span style="font-size: 13.3333px;"><br>
</span></div>
<div style=""><span style="font-size: 13.3333px;">I added -stdlib=libc++, but I got:</span></div>
<div style=""><span style="font-size: 13.3333px;">
<div>/tmp/Morphology_1-1e9ee6.o: In function `main':</div>
<div>Morphology_1.cpp:(.text+0xe7): undefined reference to `cv::CommandLineParser::CommandLineParser(int, char const* const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'</div>
<div>Morphology_1.cpp:(.text+0x1cf): undefined reference to `cv::samples::findFile(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool)'</div>
<div>Morphology_1.cpp:(.text+0x1ec): undefined reference to `cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)'</div>
<div>Morphology_1.cpp:(.text+0x4d4): undefined reference to `cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)'</div>
<div>Morphology_1.cpp:(.text+0x58f): undefined reference to `cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)'</div>
<div>Morphology_1.cpp:(.text+0x64d): undefined reference to `cv::moveWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, int)'</div>
<div>Morphology_1.cpp:(.text+0x7bc): undefined reference to `cv::createTrackbar(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
 > const&, int*, int, void (*)(int, void*), void*)'</div>
<div>Morphology_1.cpp:(.text+0x93d): undefined reference to `cv::createTrackbar(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
 > const&, int*, int, void (*)(int, void*), void*)'</div>
<div>Morphology_1.cpp:(.text+0xab8): undefined reference to `cv::createTrackbar(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
 > const&, int*, int, void (*)(int, void*), void*)'</div>
<div>Morphology_1.cpp:(.text+0xbfd): undefined reference to `cv::createTrackbar(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
 > const&, int*, int, void (*)(int, void*), void*)'</div>
<div>/tmp/Morphology_1-1e9ee6.o: In function `Erosion(int, void*)':</div>
<div>Morphology_1.cpp:(.text+0x1069): undefined reference to `cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)'</div>
<div>/tmp/Morphology_1-1e9ee6.o: In function `Dilation(int, void*)':</div>
<div>Morphology_1.cpp:(.text+0x13c9): undefined reference to `cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)'</div>
<div>/tmp/Morphology_1-1e9ee6.o: In function `std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > cv::CommandLineParser::get<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >(std::__1::basic_string<char,
 std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) const':</div>
<div>Morphology_1.cpp:(.text._ZNK2cv17CommandLineParser3getINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEET_RKS8_b[_ZNK2cv17CommandLineParser3getINSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEET_RKS8_b]+0xf7): undefined
 reference to `cv::CommandLineParser::getByName(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, cv::Param, void*) const'</div>
<div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><span style="font-size:13.3333px"><br>
</span></div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Do you know how to fix this issue?</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Thanks,</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Stefano</div>
</div>
</div>
</div>
</div>
</body>
</html>