在 Mac OS Catalina 中使 --std=C++17 默认
Making --std=C++17 default in Mac OS Catalina
我经常使用 g++ --std=c++17 sol.cpp
,所以我想将其设为默认值。为此,我已经阅读了此处的许多答案,但 none 其中的答案在我的系统中有效。
我试过别名,
alias g++='g++ --std=c++17'
在我的 .bash_profile
中,但它不起作用。
请帮我解决这个问题,对此我将不胜感激。
谢谢
Apple 出于许可问题将 shell 从 bash 更改为 zsh。
因此配置文件现在是 .zshrc 和 .zprofile。
为 ~/.zshrc
添加别名
alias g++='g++ -std=c++17'
别忘了重启终端。
我经常使用 g++ --std=c++17 sol.cpp
,所以我想将其设为默认值。为此,我已经阅读了此处的许多答案,但 none 其中的答案在我的系统中有效。
我试过别名,
alias g++='g++ --std=c++17'
在我的 .bash_profile
中,但它不起作用。
请帮我解决这个问题,对此我将不胜感激。 谢谢
Apple 出于许可问题将 shell 从 bash 更改为 zsh。 因此配置文件现在是 .zshrc 和 .zprofile。
为 ~/.zshrc
添加别名
alias g++='g++ -std=c++17'
别忘了重启终端。