I am trying to relearn C++ after taking an intro course a few years ago and I’m having some basic problems. My current problem occurs when trying to use a friend function. H
This problem happen because you are calling fun.cpp instead of fun.hpp. So c++ compile find func.cpp definition twice and throw this error.
Pls, change line 3 of your main.cpp file, from #include "fun.cpp" to #include "fun.hpp"