File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,13 @@ g++ main.cpp -o main
7171Windows 上:
7272
7373``` bash
74- clang++.exe -c main.cpp -o main.exe
74+ clang++.exe main.cpp -o main.exe
7575```
7676
7777Linux / MacOS 上:
7878
7979``` bash
80- clang++ -c main.cpp -o main
80+ clang++ main.cpp -o main
8181```
8282
8383## 编译器选项
@@ -87,7 +87,7 @@ clang++ -c main.cpp -o main
8787例如当我们说“编译这个源码时,我用了 GCC 编译器,` -O3 ` 和 ` -std=c++20 ` 选项”,说的就是把这些选项加到了 ` g++ ` 的命令行参数中:
8888
8989``` bash
90- g++ -O3 -std=c++20 -c main.cpp -o main
90+ g++ -O3 -std=c++20 main.cpp -o main
9191```
9292
9393其中 Clang 和 GCC 的编译器选项有很大交集。而 MSVC 基本自成一派。
@@ -109,13 +109,13 @@ MSVC:`/std:c++98`、`/std:c++11`、`/std:c++14`、`/std:c++17`、`/std:c++20`
109109GCC(Linux):
110110
111111``` bash
112- g++ -std=c++20 -c main.cpp -o main
112+ g++ -std=c++20 main.cpp -o main
113113```
114114
115115Clang(Linux):
116116
117117``` bash
118- clang++ -std=c++20 -c main.cpp -o main
118+ clang++ -std=c++20 main.cpp -o main
119119```
120120
121121MSVC(Windows):
You can’t perform that action at this time.
0 commit comments