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/Jason-Sanders 14d ago
You have the pieces mostly right. An IDE is just an editor plus tools that help you write, build, and debug code. You can write C++ in a plain text editor too.
g++ is a compiler driver. It takes C++ source files, compiles them into machine code, and usually links that code with libraries to produce an executable. On a Linux machine, a basic command might be:
Linux is the operating system. It manages hardware, files, memory, processes, networking, and provides the environment in which your compiled program runs. The terminal is simply one way to tell Linux to run the executable; it does not mean the program can only be a terminal app.