1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00

g++: add page (#1718)

This commit is contained in:
Starbeamrainbowlabs 2017-11-30 10:05:39 +00:00 committed by GitHub
commit 6f7c13fa5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

20
pages/common/g++.md Normal file
View file

@ -0,0 +1,20 @@
# gplusplus
> Compiles C++ source files.
> Part of GCC (GNU Compiler Collection).
- Compile a source code file into an executable binary:
`g++ {{source.cpp}} -o {{output_executable}}`
- Display (almost) all errors and warnings:
`g++ {{source.cpp}} -Wall -o {{output_executable}}`
- Choose a language standard to compile for(C++98/C++11/C++14/C++17):
`g++ {{source.cpp}} -std={{language_standard}} -o {{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}}`