【发布时间】:2014-06-20 16:55:47
【问题描述】:
我有一个使用正则表达式的项目的 Makefile。因此我需要使用 g++-4.9 和 c++11。
BIN = bin
OBJ = src/main.o src/time2.o src/except.o src/except2.o src/struct.o src/index.o
FLAGS = -lncurses
CC = g++-4.9 -std=c++11 -Wall -pedantic -Wno-long-long -O0 -ggdb
all: compile
run: compile
./$(BIN)
clean:
rm -f $(BIN) $(OBJ)
compile: $(OBJ)
$(CC) -o $(BIN) $(OBJ) $(FLAGS)
但是当我尝试编译时:
g++ -c -o src/main.o src/main.cpp In file included from /usr/include/c++/4.8/regex:35:0, from src/time2.h:16, from src/main.cpp:3: /usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the \ ^ In file included from src/main.cpp:5:0: src/struct.h:99:18: error: ‘regex’ has not been declared bool isnamegood(regex x,const string& name); ^
所以我不明白出了什么问题,请您帮帮我吗?
【问题讨论】: