Yes, that is one of the causes of that error. C++ compile errors are meant to be pretty specific and usually have all the information that you need in the actual error text.
Unfortunately, including a cpp is not illegal. In fact, the Engine uses this to manage it’s unity build process. So there’s no way to generate what you would think would be the “intuitive” error message.