Jason T. Slack-Moehrle wrote: > Hello, > > I am trying to use come C++v11 features and am trying to get the > compiling to work. > > The error: > [jtsm@server]$ ./build.sh > -- The C compiler identification is Clang 4.0.0 > -- The CXX compiler identification is Clang 4.0.0 > -- Check for working C compiler: /usr/bin/clang > -- Check for working C compiler: /usr/bin/clang -- works > -- Detecting C compiler ABI info > -- Detecting C compiler ABI info - done > -- Check for working CXX compiler: /usr/bin/clang++ > -- Check for working CXX compiler: /usr/bin/clang++ -- works > -- Detecting CXX compiler ABI info > -- Detecting CXX compiler ABI info - done > -- Found OpenGL: /System/Library/Frameworks/OpenGL.framework > -- Found GLUT: -framework GLUT > -- Configuring done > -- Generating done > -- Build files have been written to: /Users/jtsm/Dropbox/Projects/All-Stars > Scanning dependencies of target All-Stars > [100%] Building CXX object CMakeFiles/All-Stars.dir/main.cpp.o > /Users/jtsm/Dropbox/Projects/All-Stars/main.cpp:4:10: fatal error: > 'thread' file not found > #include <thread> > ^ > 1 error generated. > make[2]: *** [CMakeFiles/All-Stars.dir/main.cpp.o] Error 1 > make[1]: *** [CMakeFiles/All-Stars.dir/all] Error 2 > make: *** [all] Error 2 > > [jtsm@server ]$ clang -v > Apple clang version 4.0 (tags/Apple/clang-421.10.60) (based on LLVM 3.1svn) > Target: x86_64-apple-darwin12.0.0 > Thread model: posix > [jtsm@server ]$ clang++ -v > Apple clang version 4.0 (tags/Apple/clang-421.10.60) (based on LLVM 3.1svn) > Target: x86_64-apple-darwin12.0.0 > Thread model: posix > > in my 'build.sh' I have: > > #/bin/bash
mkdir build && cd build
> CC=clang CXX=clang++ cmake .
CC=clang CXX=clang++ cmake ..
> make
> SET( CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++" )
>
> PROJECT( ${PROJECT_NAME} )
PROJECT will set up the compiler and stuff. And in this process it will set
CMAKE_CXX_FLAGS, i.e. will overwrite your lines. Exchange the lines and make
sure not to overwrite the existing flags, but append to them.
Eike
--
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
