I am trying to implement Header Files with Source Files using C++, but in the terminal the give me some errors.
Here is the code:
main.cpp
#include <iostream> #include "add.h" using namespace std; int main() { cout << "The Sum of 3 and 4 is: " << add(3,4) << endl; return 0; } add.cpp
int add(int x, int y) { return (x + y); } add.h
#ifndef ADD_H #define ADD_H int add(int x, int y); #endif 
#include "add.h"fromadd.cpp. Second, the error message you pointed is apparently more related to the way you invoke clang than to the code itself.