简体   繁体   English

如何在Kali Linux中的make命令中启用c ++ 11

[英]How to enable c++11 in make command in kali linux

I am installing codeblocks in kali linux using source files. 我正在使用源文件在kali linux中安装代码块。 but when I issue make command I got the following error 但是当我发出make命令时,出现以下错误

usr/include/c++/6/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

I googled for this error and got the following solution of using this in my Makefile and recompile 我用谷歌搜索了此错误,并获得了在我的Makefile中使用此错误的以下解决方案并重新编译

CXX=clang++
CXXFLAGS=-g -std=c++11 -Wall -pedantic
BIN=prog

SRC=$(wildcard *.cpp)
OBJ=$(SRC:%.cpp=%.o)

all: $(OBJ)
        $(CXX) -o $(BIN) $^

%.o: %.c
        $(CXX) $@ -c $<

clean:
        rm -f *.o
        rm $(BIN)

but this also don't works. 但这也不起作用。 I am new to linux and have no idea how to enable c++11 mode in gcc. 我是linux新手,不知道如何在gcc中启用c ++ 11模式。

The CXXFLAGS aren't being used. 没有使用CXXFLAGS You can modify the all rule to 您可以将所有规则修改为

all: $(OBJ)
    $(CXX) $(CXXFLAGS) -o $(BIN) $^

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM