I cannot for the life of me get clang to stop warning me about C++11 extensions. Anywhere I use "auto" or any other C++11 extension it spits out a warning.
I have the flag -Wno-c++11-extension
but it still prints them.
Here's my makefile:
CXX = clang++
CXXFLAGS = -std=c++11 -Wall -Wno-c++11-extensions
LIBS = -lglfw -lGL -lGLU -lGLEW
OBJ_DIR = bin
LIB_DIR = -L/usr/lib
INC_DIR = -I/usr/include
SOURCE = $(wildcard *.cpp)
OBJECTS = ${SOURCE:%.cpp=$(OBJ_DIR)/%.o}
EXECUTABLE = vox
ARGS = -w1024 -h800
.PHONY: init clean
all: init $(OBJECTS) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(CXXFLAGS) $(LIB_DIR) -o $@ $(OBJECTS) $(LIBS)
$(OBJ_DIR)/%.o: %.cpp
$(CXX) $(INC_DIR) -c $< -g -o $@
run: init $(EXECUTABLE)
@echo $(ls . | grep *.cpp)
@./$(EXECUTABLE) $(ARGS)
init:
@mkdir -p "$(OBJ_DIR)"
clean:
@rm -rf $(OBJ_DIR) $(EXECUTABLE)
Here's my clang++ --version
output
Ubuntu clang version 3.2-1~exp5ubuntu1~precise1 (tags/RELEASE_32/final) (based on LLVM 3.2)
Target: x86_64-pc-linux-gnu
Thread model: posix
You need to pass all the compiler options to the compilation step as well:
$(OBJ_DIR)/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INC_DIR) -c $< -g -o $@
# ^^^^^^^^^^^
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With