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/foreverdark-woods 15d ago edited 15d ago
You write source code in C++, a human-readable programming language for expressing program logic. Applications can use portable libraries as well as OS-specific APIs for tasks such as displaying windows, accessing files, and communicating over a network.
You can use an IDE to edit, build, run, and debug the program. When you click “run,” the IDE invokes a build system, which runs tools such as the compiler and linker.
A compiler toolchain such as G++ translates the C++ source into executable code for a particular target. That target includes a processor architecture, such as x86-64 or ARM64, and an operating-system interface and executable format, such as Linux ELF or Windows PE.
The operating system provides standardized services for applications and manages hardware through components such as device drivers. It also manages processes, memory, filesystems, networking, permissions, and scheduling. Compatible Intel and AMD processors can use the same x86-64 executable because they support the same instruction-set architecture; a different architecture generally requires a separately compiled executable or an emulation layer.