Just like we specify input flags in the settings of the project in Xcode
Can I make few flags like -O3 or 开发者_JAVA技巧-fopenmp as default flags in command line when I use Terminal.
So that I dont have to type them everytime I compile some c++ fies. Is there a file in the installed gcc or C++ that I can edit to make them default. Please let me know thanksFor situations like this you'd probably use a makefile if it's project specific (or other similar automated build management like scons or cmake).
If you want it always on the terminal, you can alias your command to always specify those options, i.e.
alias g++='g++ -O3 -fopenmp'
Note that you said 'terminal' so I assume this is a type of *nix. If that is the case you can also set this into your terminal profile, like ~/.bashrc
if you use bash, or ~/.zshrc
if you use zsh, etc.
精彩评论