Skip to content

Visual Studio 2015 compiling error??? #1

Description

@yudiannlu

fsm.h was unable to compiled caused by "template" keyword error:

1>f:\projectarea\googletest\gtestharness\fsm.h(38): error C2059: syntax error: 'template'
1> f:\projectarea\googletest\gtestharness\fsm.h(124): note: see reference to function template instantiation 'int SwitchTemplate::work<StateMachine<LightSwitch,STATELIST>::CallEventNoData>(int,CONTEXT &)' being compiled
1> with
1> [
1> STATELIST=LightSwitch::StateList,
1> CONTEXT=StateMachine<LightSwitch,LightSwitch::StateList>::CallEventNoData
1> ]
1> f:\projectarea\googletest\gtestharness\fsm.h(124): note: see reference to function template instantiation 'int SwitchTemplate::work<StateMachine<LightSwitch,STATELIST>::CallEventNoData>(int,CONTEXT &)' being compiled
1> with
1> [
1> STATELIST=LightSwitch::StateList,
1> CONTEXT=StateMachine<LightSwitch,LightSwitch::StateList>::CallEventNoData
1> ]
1> f:\projectarea\googletest\gtestharness\fsm.h(122): note: while compiling class template member function 'void StateMachine<LightSwitch,LightSwitch::StateList>::work(void)'
1> f:\projectarea\googletest\gtestharness\fsm_test.cpp(34): note: see reference to function template instantiation 'void StateMachine<LightSwitch,LightSwitch::StateList>::work(void)' being compiled
1> f:\projectarea\googletest\gtestharness\fsm_test.cpp(32): note: see reference to class template instantiation 'StateMachine<LightSwitch,LightSwitch::StateList>' being compiled
1>f:\projectarea\googletest\gtestharness\fsm.h(38): error C2951: template declarations are only permitted at global, namespace, or class scope

Thanks
Lu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions