g++, gcc: page update (#7821)

* Update placeholders:
- use "path/to"
- join list of placeholders in gcc

* Suggest language standard in code example

Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>

Co-authored-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
This commit is contained in:
Emily Grace Seville
2022-03-02 03:36:03 -08:00
committed by GitHub
parent c4a72c36b4
commit 02c427a039
2 changed files with 10 additions and 10 deletions

View File

@@ -6,16 +6,16 @@
- Compile a source code file into an executable binary:
`g++ {{source.cpp}} -o {{output_executable}}`
`g++ {{path/to/source.cpp}} -o {{path/to/output_executable}}`
- Display (almost) all errors and warnings:
`g++ {{source.cpp}} -Wall -o {{output_executable}}`
`g++ {{path/to/source.cpp}} -Wall -o {{path/to/output_executable}}`
- Choose a language standard to compile for(C++98/C++11/C++14/C++17):
- Choose a language standard to compile for (C++98/C++11/C++14/C++17):
`g++ {{source.cpp}} -std={{language_standard}} -o {{output_executable}}`
`g++ {{path/to/source.cpp}} -std={{c++98|c++11|c++14|c++17}} -o {{path/to/output_executable}}`
- Include libraries located at a different path than the source file:
`g++ {{source.cpp}} -o {{output_executable}} -I{{header_path}} -L{{library_path}} -l{{library_name}}`
`g++ {{path/to/source.cpp}} -o {{path/to/output_executable}} -I{{path/to/header}} -L{{path/to/library}} -l{{library_name}}`