<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;" class="">Hi all,<div class=""><br class=""></div><div class="">I’m writing a CMake file for a project that should be compiled both in Ubuntu and OS X.</div><div class="">I want to use eclipse as IDE, gcc and C++ 11.</div><div class=""><br class=""></div><div class="">I read different threads that suggest how to enable C++ 11 in eclipse.</div><div class="">According to them I included these lines in my CMake:</div><div class=""><br class=""></div><div class="">set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")</div><div class=""><br class=""></div><div class=""><div class="">if (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4")</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>set(CMAKE_CXX_COMPILER_ARG1 "-std=c++11" CACHE STRING "C++ version for eclipse" FORCE)</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>set(CMAKE_ECLIPSE_VERSION "4.3" CACHE STRING "Eclipse version" FORCE)</div><div class="">endif (${CMAKE_EXTRA_GENERATOR} MATCHES "Eclipse CDT4”)</div></div><div class=""><br class=""></div><div class="">However, eclipse still set a wrong value for the symbol __cplusplus (199711L instead of 201103L I guess).</div><div class="">For this reason eclipse is not able to index C++ 11 features such as shared pointer.</div><div class="">Therefore I get a syntax error also if the code compiles.</div><div class=""><br class=""></div><div class="">Any idea on how can I address this issue?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Luca</div><div class=""><br class=""></div><div class=""><br class=""><div apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""></div>

</div>

<br class=""></div></body></html>