Skip to content
Quiz · Building and the Preprocessor · lesson 7 of 8

Quiz — undefined reference

What happens when these files are built with the command clang++ main.cpp?

C++
// triple.h
int triple(int x);

// triple.cpp
#include "triple.h"
int triple(int x) { return x * 3; }

// main.cpp
#include "triple.h"
int main() { return triple(14); }

Subscribe to take the course

The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.

Sign in another way