Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making -std=c++11 the default in mac terminal

Tags:

People also ask

What is macOS default shell?

Mac OS X Shells Mac OS X comes with the Bourne Again SHell (bash) as the default user shell and also includes the TENEX C shell (tcsh), the Korn shell (ksh), and the Z shell (zsh). bash, ksh, and zsh are compatible with sh, the original Bourne shell.

How do I change my default bash shell on Mac?

From System Preferences Hold the Ctrl key, click your user account's name in the left pane, and select “Advanced Options.” Click the “Login Shell” dropdown box and select “/bin/bash” to use Bash as your default shell or “/bin/zsh” to use Zsh as your default shell. Click “OK” to save your changes.


When I want to compile, I need to specify -std=c++11 like this:

g++ -Wall -std=c++11 main.cpp -o main

and I wonder if there was a solution to set the -std=c++11 flag permanently so it will be possible to do:

 g++ -Wall main.cpp -o main

without flags.