0

I am using windows 8.1 and have installed GCC compiler on my machine. Every time I have to compile a c++ file (using c++ 11 features), on the command prompt I need to type g++ file.cpp -std=c++11. Is there a way so that I don't need to type -std=c++11 everytime? Also please note that I cannot use make files and the file will always be compiled through command line.

Varun Sharma
  • 2,591
  • 8
  • 45
  • 63

2 Answers2

2

You can write a batch file to invoke gcc with -std=c++11 and save it to one of your PATH directories

Or you should be able to add -std=c++11 to GCC specs file to effectively change GCC's default configurations.

KetZoomer
  • 2,701
  • 3
  • 15
  • 43
nodakai
  • 7,773
  • 3
  • 30
  • 60
0

you can create alias and put in .bashrc file alias g++='g++ -std=c++11'

Alok Prasad
  • 622
  • 7
  • 12