"SFML Game Engine Part 1 - State Machine" - errors

  • cptrko
    Likes 0

    Problem Description

    After I watched the video and wrote whole code from it, I'm getting a bunch of errors. Please mind the fact that I have basic knowledge in programming, and I’m trying to improve it. Would love to someday make a game or two :)

    Here is the bugs list:

    ||=== Build: Debug in *** (compiler: GNU GCC Compiler) ===|
    ***\stateMachine.hpp|11|error: 'unique_ptr' does not name a type|
    ***\stateMachine.hpp|19|error: 'StateRef' has not been declared|
    ***\stateMachine.hpp|24|error: 'StateRef' does not name a type|
    ***\stateMachine.hpp|27|error: 'StateRef' was not declared in this scope|
    ***\stateMachine.hpp|27|error: template argument 1 is invalid|
    ***\stateMachine.hpp|27|error: template argument 2 is invalid|
    ***\stateMachine.hpp|28|error: 'StateRef' does not name a type|
    ***\stateMachine.cpp|5|error: variable or field 'AddState' declared void|
    ***\stateMachine.cpp|5|error: 'StateRef' was not declared in this scope|
    ***\stateMachine.cpp|5|error: expected primary-expression before 'bool'|
    ***\stateMachine.cpp||In member function 'void Razor::StateMachine::RemoveState()':|
    ***\stateMachine.cpp|15|error: 'class Razor::StateMachine' has no member named '_isRemoving'|
    ***\stateMachine.cpp||In member function 'void Razor::StateMachine::ProcessStateChanges()':|
    ***\stateMachine.cpp|20|error: 'class Razor::StateMachine' has no member named '_isRemoving'|
    ***\stateMachine.cpp|20|error: request for member 'empty' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|22|error: request for member 'pop' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|24|error: request for member 'empty' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|26|error: request for member 'top' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|29|error: 'class Razor::StateMachine' has no member named '_isRemoving'|
    ***\stateMachine.cpp|31|error: 'class Razor::StateMachine' has no member named '_isAdding'|
    ***\stateMachine.cpp|33|error: request for member 'empty' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|35|error: 'class Razor::StateMachine' has no member named '_isReplacing'|
    ***\stateMachine.cpp|37|error: request for member 'pop' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|41|error: request for member 'top' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|45|error: request for member 'push' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|45|error: 'class Razor::StateMachine' has no member named '_newState'|
    ***\stateMachine.cpp|45|error: 'move' was not declared in this scope|
    ***\stateMachine.cpp|46|error: request for member 'top' in '((Razor::StateMachine*)this)->Razor::StateMachine::_states', which is of non-class type 'int'|
    ***\stateMachine.cpp|47|error: 'class Razor::StateMachine' has no member named '_isAdding'|
    ***\stateMachine.cpp|51|error: 'StateRef' does not name a type|
    ||=== Build failed: 28 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

     


  • Sonar Systems admin
    Likes 0

    Do all the other videos, then run it.

  • PhamHoangNam
    Likes 0

    me too. please help me!


    Error (active) E0276 name followed by '::' must be a class or namespace name flappy bird d:\SFML Group\flappy bird\flappy bird\StateMachine.cpp 5 

    Severity Code Description Project File Line Suppression State
    Error C2227 left of '->_newState' must point to class/struct/union/generic type flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 10 
    Error C2227 left of '->_isReplacing' must point to class/struct/union/generic type flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 8 
    Error C2227 left of '->_isAdding' must point to class/struct/union/generic type flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 7 
    Error C2355 'this': can only be referenced inside non-static member functions or non-static data member initializers flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 8 
    Error C2355 'this': can only be referenced inside non-static member functions or non-static data member initializers flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 7 
    Error C2355 'this': can only be referenced inside non-static member functions or non-static data member initializers flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 10 
    Error (active) E0258 'this' may only be used inside a nonstatic member function flappy bird d:\SFML Group\flappy bird\flappy bird\StateMachine.cpp 7 
    Error (active) E0258 'this' may only be used inside a nonstatic member function flappy bird d:\SFML Group\flappy bird\flappy bird\StateMachine.cpp 8 
    Error (active) E0258 'this' may only be used inside a nonstatic member function flappy bird d:\SFML Group\flappy bird\flappy bird\StateMachine.cpp 10 
    Error C2535 'Sonar::StateMachine::StateMachine(void)': member function already defined or declared flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.hpp 16 
    Error C2653 'SateMachine': is not a class or namespace name flappy bird d:\sfml group\flappy bird\flappy bird\statemachine.cpp 5 
     

  • PhamHoangNam
    Likes 0


     


  • Sonar Systems admin
    Likes 0

    @PhamHoangNam Try the other videos as well

Login to reply