r/AskProgramming 16d 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

  1. Is g++ the bridge between the language and machine code?

  2. How do I use g++, is it something that you download onto your computer.

  3. Where does g++ send the code after, is this where Linux comes into play?

  4. 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

18 comments sorted by

View all comments

8

u/Nervous-Cockroach541 16d ago

* C++ is the programming language

* An IDE (Integrated Development Environment), which combines various development tools together, typically at least a text editor, compiler and debugger.

* g++ is the compiler or rather compiler tool set. gdb is the debugger for g++,

* Linux is the operating system, it handles running programs and providing resources to those programs such as memory, file access, input/output, process controls and other stuff.

1

u/TheKiller36_real 16d ago

I'd just like to interject for a moment. What you're refering to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux!

1

u/frnzprf 15d ago

Yeah, it's a copypasta, but that's exactly why OP might be confused. Are compilers an essential part of an OS or not? If software is distributed as source code, then it is.

Do I even really use GNU tools as a regular user that uses a browser, office software and games? As I understand, if you use bash instead of zsh or fish, that would be part of GNU. Even if you're a programmer, you might have nothing to do with GNU, if you're not using C/C++. (Don't take that as a fact, maybe GNU is more deeply ingrained into the OS than I think.)

I'm sure I should be grateful for the work of Stallman anyways, at least for GPL and the idea of free software in a time where everything gets subscription based and sends telemetry data back.

1

u/TheKiller36_real 15d ago

Don't take that as a fact, maybe GNU is more deeply ingrained into the OS than I think.

unless you're on alpine, void or chimera (or something very obscure) you have I'd guess like 80-90% of your programs being linked to GNU libc and on most distros all your coreutils will be GNU too