[cmake-developers] [CMake][BUG] C++11 support broken for SolarisStudio 12.4

CHEVRIER, Marc marc.chevrier at sap.com
Fri Sep 25 03:58:50 EDT 2015


Hi,

Currently, it is not possible to use C++11 mode on Solaris with SolarisStudio 12.4 (test done on Solaris 11.2 sparc).
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.
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…

Here is the log (see red lines):
/opt/solarisstudio12.4/bin/CC    -std=c++11 -o CMakeFiles/Test.dir/test.cpp.o -c /usr/u/i051466/tests/cmake/build/test.cpp
[100%] Linking CXX executable Test
/usr/u/i051466/INSTALL.122/bin/cmake -E cmake_link_script CMakeFiles/Test.dir/link.txt --verbose=1
/opt/solarisstudio12.4/bin/CC      CMakeFiles/Test.dir/test.cpp.o  -o Test
Undefined                       first referenced
 symbol                             in file
std::ctype<char>::_M_widen_init()const    CMakeFiles/Test.dir/test.cpp.o
std::ostream::put(char)                         CMakeFiles/Test.dir/test.cpp.o
std::__throw_bad_cast()             CMakeFiles/Test.dir/test.cpp.o
__SUNW_ABIG3_cpp_personality        CMakeFiles/Test.dir/test.cpp.o
__cxxabiv1::register_exit_code(void (*)(void)extern"C") CMakeFiles/Test.dir/test.cpp.o
std::ostream::flush()                       CMakeFiles/Test.dir/test.cpp.o
std::cout                           CMakeFiles/Test.dir/test.cpp.o
[Hint: static member std::cout must be defined in the program]

std::ios::clear(std::_Ios_Iostate) CMakeFiles/Test.dir/test.cpp.o
std::ios_base::Init::~Init()             CMakeFiles/Test.dir/test.cpp.o
std::ios_base::Init::Init()             CMakeFiles/Test.dir/test.cpp.o
std::ostream & std::__ostream_insert<char, std::char_traits<char> >(std::ostream &,const char*,int) CMakeFiles/Test.dir/test.cpp.o
ld: fatal: symbol referencing errors

FYI:
* If I add option –std=c++11 in the file …/Test.dir/link.txt, link is successful
* 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).

Marc


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150925/b118d45f/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150925/b118d45f/attachment.txt>


More information about the cmake-developers mailing list