Your A.cpp doesn't know anything about any template function "nice"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//fileA.cpp
#include <iostream>
//and here I don't include header.h <-- why?
// if you just include it here:
#include "header.h" // Without this A.cpp doesn't know that there is a function nice
// and certainly doesn't know anything about whatever is going on in B.cpp
// Or you just include B.cpp
#include "B.cpp" // I don't know why you would include the cpp instead of the h
// however it's possible
int main()
{
nice(5);//error
}
Summary: you have to include either header.h or B.cpp