Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

understanding c++, compilation etc [closed]

Do you know a good, concise (not a book, possibly free documentation) reference that explains the basics of how a c++ compiler works? I think it'd be beneficial for better understanding some rules of c++ programming.

like image 838
Bob Avatar asked Mar 18 '11 08:03

Bob


People also ask

What are 4 Substages of compilation process?

Four Steps of Compilation: preprocessing, compiling, assembly, linking.

What are the 3 steps of the compilation process?

There are three basic steps involved in compiling a C program: preprocessing, compilation of C source code to machine code (or assembly) (also called object code), and linking of multiple object files into a single binary executable program.

What happens after compilation in C?

Linking is the final stage of compilation. It takes one or more object files or libraries as input and combines them to produce a single (usually executable) file.


2 Answers

GCC Internals free ebook.

The purpose of this book is to address the demands of GCC hackers. We start with a description of GCC 3.4.1 architecture focusing on the source code parser. We chose this version of GCC because we used this version mostly. Then we address the problem of extension development. We present the GCC Extensibility Modules (GEM) project in the next chapter. GEM provides a number of hooks throughout GCC source code. It is implemented as a patch to GCC. A GEM-based compiler extension is developed as a stand-alone program. When the extension is completed, only its source code is distributed compared with distributing the source code of the GCC if GEM is not used. We give examples that demonstrate GEM programming at the end of the book.

(EDIT: Sorry, I missed you don't want a book. But I still think this is great resource of information you are looking for. You certainly don't need to read it as a whole, you can go only through the sections you are interested in.)

like image 128
Matěj Zábský Avatar answered Oct 06 '22 22:10

Matěj Zábský


I found this university site which explains the steps of the compilation process. It covers how to compile your code into an executable, a shared library, or a dynamically linked library using GCC. It also covers how the compiler knows where to look for header files and libraries, and other topics.

like image 36
Cody Piersall Avatar answered Oct 06 '22 21:10

Cody Piersall