<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hi,</div>
<div><br>
</div>
<div>Currently, it is not possible to use C++11 mode on Solaris with SolarisStudio 12.4 (test done on Solaris 11.2 sparc).</div>
<div>If I try a simple executable (see attached file), compilation is OK (option –std=c++11 is correctly passed to compiler) but link failed because, with SolarisStudio compiler, option –std=c++11 is also required at link time and is currently missed.</div>
<div>And unfortunately, it seems there is no equivalent to compile configuration variable CMAKE_CXX11_STANDARD_COMPILE_OPTION for the linker so no so easy to fix this problem…</div>
<div><br>
</div>
<div>Here is the log (see red lines):</div>
<div>
<div><font color="#ff0000">/opt/solarisstudio12.4/bin/CC    -std=c++11 -o CMakeFiles/Test.dir/test.cpp.o -c /usr/u/i051466/tests/cmake/build/test.cpp</font></div>
<div>[100%] Linking CXX executable Test</div>
<div>/usr/u/i051466/INSTALL.122/bin/cmake -E cmake_link_script CMakeFiles/Test.dir/link.txt --verbose=1</div>
<div><font color="#ff0000">/opt/solarisstudio12.4/bin/CC      CMakeFiles/Test.dir/test.cpp.o  -o Test  </font></div>
<div>Undefined                       first referenced</div>
<div> symbol                             in file</div>
<div>std::ctype<char>::_M_widen_init()const    CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::ostream::put(char)                         CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::__throw_bad_cast()             CMakeFiles/Test.dir/test.cpp.o</div>
<div>__SUNW_ABIG3_cpp_personality        CMakeFiles/Test.dir/test.cpp.o</div>
<div>__cxxabiv1::register_exit_code(void (*)(void)extern"C") CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::ostream::flush()                       CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::cout                           CMakeFiles/Test.dir/test.cpp.o</div>
<div>[Hint: static member std::cout must be defined in the program]</div>
<div><br>
</div>
<div>std::ios::clear(std::_Ios_Iostate) CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::ios_base::Init::~Init()             CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::ios_base::Init::Init()             CMakeFiles/Test.dir/test.cpp.o</div>
<div>std::ostream & std::__ostream_insert<char, std::char_traits<char> >(std::ostream &,const char*,int) CMakeFiles/Test.dir/test.cpp.o</div>
<div>ld: fatal: symbol referencing errors</div>
</div>
<div><br>
</div>
<div>FYI:</div>
<div>* If I add option –std=c++11 in the file …/Test.dir/link.txt, link is successful </div>
<div>* I built CMake using version 12.2 of SolarisStudio because if I use SolarisStudio 12.4, cmake tool is unsuable (I will sent another mail describing this problem).</div>
<div><br>
</div>
<div>Marc</div>
</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE">
<div>
<div style="font-family: Calibri; font-size: 15px;"><font face="Arial" size="1"><span style="font-size: 8pt;"></span></font></div>
</div>
<br>
</div>
</div>
</body>
</html>