From 2480d161ebcc176ec812c5eb0a8c21da2f973060 Mon Sep 17 00:00:00 2001 From: Nalin Bhardwaj Date: Thu, 30 Nov 2017 10:38:29 +0530 Subject: [PATCH 1/2] g++: Add page --- pages/common/g++.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/common/g++.md diff --git a/pages/common/g++.md b/pages/common/g++.md new file mode 100644 index 0000000000..cf0426e1f8 --- /dev/null +++ b/pages/common/g++.md @@ -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}}` From 733d23ca389000fb9ca4233f88384cbca209ba22 Mon Sep 17 00:00:00 2001 From: Nalin Bhardwaj Date: Thu, 30 Nov 2017 12:55:37 +0530 Subject: [PATCH 2/2] g++: Doing requested changes. --- pages/common/g++.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/g++.md b/pages/common/g++.md index cf0426e1f8..ff840e278a 100644 --- a/pages/common/g++.md +++ b/pages/common/g++.md @@ -1,4 +1,4 @@ -# Gplusplus +# gplusplus > Compiles C++ source files. > Part of GCC (GNU Compiler Collection). @@ -7,7 +7,7 @@ `g++ {{source.cpp}} -o {{output_executable}}` -- Activate output of (almost) all errors and warnings: +- Display (almost) all errors and warnings: `g++ {{source.cpp}} -Wall -o {{output_executable}}`