install g++ on windows
install c++/g++ on windows
install c++/g++ on windows
1. 算是提示吧:
Pick the drive and a folder in which you want to install g++. I’ll assume that it is C:, but you can choose a different one. If you choose a different drive or a different folder, you’ll need to adapt the directions below accordingly.
2 下载 full.exe
这个文件的安全性不懂,反正下载了安装后就有一些在Linux常看到的指令的.exe文件比如
ls
mv
… (这个让我意外收获了,我是一个喜欢在Linux下码的boy)下载完后点击安装。
3 添加环境变量
Start -> Control Panel -> System -> Advanced -> Environment Variables
双击PATH
编辑,以;
作为分隔添加环境变量的路径:C:\cygnus\cygwin-b20\H-i586-cygwin32\bin
这个路径应该都是一样的。注意不要使用pwd命令然后复制路径,斜杠会成这样的/cygnus/cygwin-b...
因为在哪个文件路径下有pwd.exe
这个程序。被坑了
4 重启
g++ -g hello.cpp -o hello -lm
这个命令就可以用了
and 一些实用的Linux
命令
warming:A Cygnus Solutions entry will appear in your Programs menu, and an icon may appear on your desktop.
Don’t use them!
If you’d like to learn more about where this free compiler came from, we downloaded it from an older site of http://sourceware.org/cygwin/