Building and Libraires Items Flashcards

1
Q

What is C++ project

A

A C++ project refers to a collection of C++ source code files, libraries, and resources that work together to form a complete program or application. It involves multiple stages of processing, including compilation, assembly, linking, and execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does it mean to build a C++ project?

A

This process involves multiple steps and tools, preprocessingm compiler, assembler, and linker, which work together to process the source code, resolve dependencies, and produce the final executable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does precompiler deal with?

A

precompiler directives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the #include precompiler directive do?

A

Goes through the code and processes #include by finding the source file and pastes it in the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the input of the precompiler?

A

C++ source code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the output of the precompiler?

A

pure C++ code without any precompiler directives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the compiler do?

A

Compiler compiles the high-level program into an assembly language program. Compiles each file into a seperate object file. Each object file corresponds to a specific CPP file. Each object file has 2 areas, text area and data area

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Does the compiler deal with header files directly?

A

No, header files become a part of .cpp files after a precompiler processes the project

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the output of the compiler?

A

object files that correspomg to specific CPP files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is inside the object file?

A

CPU instructions, some initial data, symbol table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Symbol table

A

a table that matches names of labels to the addresses of the memory words that instructions occupy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Who needs symbol table

A

Linker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Linker

A

combines multiple object files and library routines into an executable file. Has CPU instructions, initialized static and global data, symbol table.Allows programs to be compiled and assembled by procedures independently, so a change to one line would require compiling and assembling only one procedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Linker Produces

A

executable file that can be run on a computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is debug build?

A

compiler doesn’t care much about optimization. It’s larger in size and slow. Its focused more on catching errors in the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Release Build

A

ast and cares about optimization but not good at debugging code because it drastically changes it. Harder to catch mistakes in your program. Used when you know your program is working and now you care more about efficiency.

17
Q

What is library?

A

to package and link reusable code into your projects.

18
Q

Static linked library: fastest way to call library routines

A

Advantages

  • No need to supply standard library separately

Disadvantages

  • Library routines become part of the executable code. If a new version of the library is released that fixes bugs or supports new hardware devices, the statically linked program keeps using the old version, or the whole program needs to be updated
  • It loads all routines in the library that are called anywhere in the executable, even if those calls are not executed.
  • Makes the program longer
19
Q

Dynamically Linked Libraries

A

library routines are not linked and loaded until the program is run. Exists as a separate fileAdvantages

  • Doesn’t require that whole libraries be copied or linked
  • Doesn’t make the program larger
  • Not touched unless they are required
  • Programs share dynamic libraries

Disadvantages

  • Require extra space for the information needed for dynamic linking
  • Version control
20
Q

What are the two options to load dynamic libraries?

A

Implicit Linking
Explicit Linking