CMake没有找到支持C ++ 11的编译器

时间:2015-11-26 11:10:12

标签: cmake

我正在尝试安装FANN库以用于项目。我使用this作为我的向导,但当我运行cmake .时,我会收到:

`$ cmake .
-- FANN is used as APPLICATION_NAME
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Could NOT find OpenMP (missing:  OpenMP_CXX_FLAGS) 
-- The compiler /usr/bin/c++ has no C++0x, C++11 or C++14 support. FANN will still work with no problem, but the tests will not be able to compile.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marvin/fann`

即使我安装了gcc / g ++ 4.9。查看Git hub的说明,运行cmake .时的输出应该是这样的:

`-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- FANN is used as APPLICATION_NAME
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp  
-- Found PythonInterp: /home/cobalt/anaconda3/bin/python (found version "3.4.3") 
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Performing Test COMPILER_SUPPORTS_CXX14
-- Performing Test COMPILER_SUPPORTS_CXX14 - Success
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- The compiler /usr/bin/c++ has C++14 support.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cobalt/repos/fann`

任何帮助?

1 个答案:

答案 0 :(得分:1)

即使您安装了gcc-4.9,它可能不在标准位置,或者您的环境变量CXX指向/usr/bin/c++,这是另一个编译器。

尝试运行cmake -D CMAKE_CXX_COMPILER /path/to/your/g++-4.9/binary" ..