I've watched several tutorials on C++ header files and did EXACTLY what they were showing, but I can't really understand why I can't use a function from other .cpp file.
Main.cpp
#include <iostream>
#include "Header.h"
int main() {
std::cout << sum(2, 2);
return 0;
}
Header.cpp
#include "Header.h"
int sum(int a, int b) {
return (a + b);
}
Header.h
#pragma once
int sum(int a, int b);