Redefinition of struct and class

I am having a problem because in my header file, it says that I have redefined the class FBullCowGame and the struct FBullCowCount, but I can’t see any other definitions for it. Anyone have a clue what is going wrong?
main.cpp
FBullCowGame.hpp
FBullCowGame.cpp

What is the exact error message (maybe a screenshot?). I skimmed over your code and couldn’t see the problem either.

OldDauber,
Thank you for your input. Here is a screenshot of the error messages. Still not sure what is going wrong.

yes, that’s strange. I suspect it might be Xcode-related project configuration problem. But anyways, try this:
Add these two lines at the very beginning of FBullCowGame.hpp

#ifndef FBULLCOWGAME_HPP
#define FBULLCOWGAME_HPP

And this line at the very end of the same file:

#endif

Then recompile the project again.

1 Like

Thank you so much for your help OldDauber. It finally works! Wondering if you could explain to me what led you to that solution.

Privacy & Terms