There are three files:

Nodes.cpp

#include "Token.h" 

Token.h

 #pragma once #include "Lexer.h" class token { }; 

Lexer.h

 #pragma once #include "Token.h" class Lexer { public: token get_next_token(); }; 

When debugging I get these errors:

Error C2059 syntax error: (

Error C2238 unexpected tokens before ";"

Error C3646 get_next_token: unknown override specifier

What is the problem?

    1 answer 1

    We start compiling cpp-file.

    Turns on token.h
    Reads the inclusion directive Lexer.h
    Lexer.h
    Inclusion directive token.h ignored by #pragma once
    Reads Lexer class declaration
    Facing an unknown token

    Any questions?
    In case there is - "what to do?" -
    In this particular case, in Nodes.cpp write #include "lexer.h"