create your c++ files from Unreal Editor using “Add a new C++ class”, it’s the best way to do it and you won’t have errors