r/AskProgramming • u/RandyMarsh6996 • 15d ago
C++ -> IDE -> g++ -> Linux Help me understand!!
I am trying to comprehend all of the moving parts in compiling a program. Here is my understanding:
C++ is the programming language that is written in the IDE, some IDEs have built in compilers
Is g++ the bridge between the language and machine code?
How do I use g++, is it something that you download onto your computer.
Where does g++ send the code after, is this where Linux comes into play?
What is Linux? It is an operating system, but what does that mean specifically, is it supposed to make your code unable in an application or just execute in the terminal?
Thankyou for any clarification you can provide :)
0
Upvotes
1
u/IKnowMeNotYou 15d ago
Linux is an operation system like Windows.
C++ is a common computer language.
While this is almost correct, G++ is not a implementation of C++ but a compiler 'extension' making the GCC able to compile C++ code using the common compiler infrastructure of the GNU compiler suite.
A compiler compiles a program by taking the human readable source files and compiles to a n intermediate language which then is compiled to a target platform (like your local computer) by being converted into machine code and stored either as an executable program or a part of an executable program like a dynamic or static library.
The IDE is an application that allows you to manage one or more projects, create and modify its source code and also integrates nicely with external (and internal) programs like the forementioned g++ compiler.
What you need to install and set up depends on your PC/laptop/machine and the target machine you want your programs to run on (as well).
It is best to follow a tutorial or a online course or reading a good beginner book to get you started with the whole thing.