检查 C++11 对 "regex" 的支持:不支持

Checking C++11 support for "regex": not supported

当我尝试编译 ArangoDB 3.0 时,出现如下问题。

wget https://www.arangodb.com/repositories/Source/ArangoDB-3.0.0.tar.gz
tar -xvvf ArangoDB-3.0.0.tar.gz
ln -s ArangoDB-3.0.0 arangodb

     OR

git clone https://github.com/arangodb/arangodb
cd arangodb 
git checkout 3.0
git pull

我已经尝试了以上两个二进制文件进行编译,如下所示。

cd arangodb/
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release

执行 cmake .. -DCMAKE_BUILD_TYPE=Release 命令时出现以下错误。

-- Checking C++11 support for "regex"
CMake Error at cmake/CheckCXX11Features.cmake:129 (message):
  Checking C++11 support for "regex": not supported
Call Stack (most recent call first):
  cmake/CheckCXX11Features.cmake:150 (cxx11_check_feature)
  CMakeLists.txt:265 (include)


-- Configuring incomplete, errors occurred!
See also "/home/ec2-user/arangodb/build/CMakeFiles/CMakeOutput.log".

OS AWS 上的版本 Linux AMI:

Linux 4.4.11-23.53.amzn1.x86_64 #1 SMP Wed Jun 1 22:22:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

GCC 版本:

gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Regex support was added in gcc 4.9 - @Bill-Lynch

您有两个选择:

  • 安装更新的编译器。
  • 检查代码并将所有正则表达式替换为等效函数。