I’m trying to set windows programming enviroment for c++. I use the Visual Studio to write the code but my University wants me to use g++ compiler. So far I managed to link g++ with the PATH using cmd but that’s not all. I have to use an alias which in linux is:
p1++="g++ -ansi -Wall -O2 -DNDEBUG -Wextra -Werror -Wno-uninitialized -Wno-sign-compare -Wshadow
I tried the same using the command doskey:
doskey p1=g++ -ansi -Wall -O2 -DNDEBUG -Wextra -Werror -Wno-uninitialized -Wno-sign-compare -Wshadow
and it works but whenever I use for example:
p1++ hello.cpp
it says
g++: fatal error: no input files
compilation terminated.
but if i use:
g++ hello.cc
It does compile, so my question is what does all that code mean and how can I get rid of that error?
Thanks
test.cpp (assumed to exist at C:\test.cpp):
Here’s what it looks like in my Windows CMD prompt:
NOTE: No quotes in alias, and it is assumed that
g++is already in yourPATH.If you wanted to have the
%p1++%environment variable persist across CMD prompts then you’d need to add an environment variable to your Windows User Profile.On Windows 7:
Create a new User Variable with name =
p1++and value =g++ -ansi -Wall -O2 -DNDEBUG -Wextra -Werror -Wno-uninitialized -Wno-sign-compare -Wshadow.