Character Instance

I’ve been copying this code exactly and I’m getting some really weird errors. For each of the things that we’re defining outside the class it keeps telling me “member function Character::setScreenPos” may not be redeclared outside its class" same with tick, also on runningTime “this declaration has no store class or type specifier” or knightPos “identifier knightPos is undefined” everything is just broken and I don’t know what happened.

Hello Mike,

Can you show your code? It will make it much easier to figure out what went wrong.

in the end I ended up getting really frustrated and just replaced my code with the code from the repository for the session and it worked. I actually ran it through a website that checks for differences between 2 pieces of text and the only things it found was a few spaces here and there (either I added spaces that the tutor didn’t within braces or I didn’t add spaces) but considering a compiler ignores whitespace that wouldn’t have affected anything. AKA it was broken because VSCode decided it didn’t like me.

With VS Code I’ve found that it can sometimes help if you delete the previously built exe file for your project. But it’s rare that it works.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms