Question: Add.cpp

```
int add(int x, int y)
{
    return x + y;
}

```

Main.cpp

```
#include <iostream>

int main()
{
    using namespace std;
    cout << "The sum of 3 and 4 is: " << add(3, 4) << endl;
    return 0;
}

```

When I try to compile this program I get an error message for line 6 of main.cpp that states: "error: 'add' was not declared in this scope".

Answer: 
Create a header file

Contents:

```
    int add(int x, y);

```

Include that file main.cpp

i.e. #include "headerfile.h"

Then the rest is up to the compiler environment. Basically need to compile each .cpp to object code and then link them. You need to read up about this as this differs between environment. Also read up on header guards and also stuff like graadle, SCONS, Makefiles. Also good to learn about version control systes e.g. mercurial.

Guess you going to have a busy day
You need `Add.h` file and include it in your `Main.cpp`

**Add.h**

```
int add(int x, int y);

```

**Main.cpp**

```
#include <iostream>
#include "Add.h"

...

```