Learn C++ Online

Compilation and execution in detail (part 2)

On this page
This lesson contains approximately 20 minutes of video content.

Prelude

Note: This lesson was developed when our development environment used an older version of clang++, i.e., clang++-10. When compiling in our environment, please use clang++: it is linked to the newest version of clang++ installed in our development container.

Compiler

Assembler

Linker

Questions

Q1

QQ1

This question is ungraded.

The following error message

tmp.cc:6:13: error: invalid operands to binary expression ('std::__1::ostream'
      (aka 'basic_ostream<char>') and 'std::vector<int>')
  std::cout << vect << std::endl;
  ~~~~~~~~~ ^  ~~~~
is an error message generated by which entity in the C++ compilation pipeline?

Q2

QQ2

This question is ungraded.

The following error message

tmp.cc:6:44: error: expression is not assignable
  for (unsigned int i = 0; i < vect.size() ++i)
                               ~~~~~~~~~~~ ^
tmp.cc:7:1: error: expected statement
is an error message generated by which entity in the C++ compilation pipeline?

Q3

QQ3

This question is ungraded.

The following error message

Undefined symbols for architecture x86_64:
  "Square(int)", referenced from:
      _main in tmp-bbcae1.o
ld: symbol(s) not found for architecture x86_64
is an error message generated by which entity in the C++ compilation pipeline?

Q4

QQ4

This question is ungraded.

Given the following error message

Undefined symbols for architecture x86_64:
  "Square(int)", referenced from:
      _main in tmp-bbcae1.o
ld: symbol(s) not found for architecture x86_64
what function is reported as being undefined?

Q5

QQ5

This question is ungraded.

What flag did we provide clang++ to stop compilation after the preprocess and compilation steps of the C++ compilation pipeline?

Q6

QQ6

This question is ungraded.

What flag did we provide clang++ to only run the preprocess, compile, and assemble steps of the C++ compilation pipeline?