Praveen Kumar Rana
Praveen Kumar Rana

Reputation: 29

Making --std=C++17 default in Mac OS Catalina

I use g++ --std=c++17 sol.cpp very frequently so I want to make this as default. To do this I have gone through many of the answers here but none of them are working in my system.

I have tried alias,

alias g++='g++ --std=c++17'

in my .bash_profile but it is not working.

Please help me with this for which I will be thankful to you. Thank You

Upvotes: 1

Views: 637

Answers (1)

3CxEZiVlQ
3CxEZiVlQ

Reputation: 38784

Apple changed shell from bash to zsh due to licensing concerns. Therefore configuration files are now .zshrc and .zprofile.

Add alias to ~/.zshrc

alias g++='g++ -std=c++17'

Don't forget to restart Terminal.

Upvotes: 3

Related Questions