add a default flag to clang++ or g++
Question
I'm trying to use clang++ or g++ to compile c++11 code by default, which means I want to omit "-std=c++11" flag when calling g++. Is there a clean way to do this?
g++ source.cc
instead of g++ -std=c++11 source.cc
Thanks!
Solution
You got some options:
- make a Makefile
use an bash alias:
alias g++="g++ -std=c++11" alias clang++="clang++ -std=c++11"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow