g++: Add page

coverage
Nalin Bhardwaj 2017-11-30 10:38:29 +05:30 committed by Nalin Bhardwaj
parent 8571c78816
commit 2480d161eb
No known key found for this signature in database
GPG Key ID: B25133FC2745D499
1 changed files with 20 additions and 0 deletions

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}}`
- Activate output of (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}}`