具体报错内容:
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.
解决:
用vi打开在执行命令make 所在目录下的 Makefile文件
vi Makefile
然后在文件中 搜索 CXXFLAGS 找到
# Add the -O flag to CXXFLAGS on cygwin as it can fix the compilation error
在找到的这行注释下面添加下面三行内容
# Add the -O flag to CXXFLAGS on cygwin as it can fix the compilation error
CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
NVCCFLAGS += -D_FORCE_INLINES -ccbin=$(CXX) -Xcompiler -fPIC $(COMMON_FLAGS) -std=c++11
LINKFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11
如图:
保存退出,再次 make 不再报上面错误了。