Skip to content

Local installation of antlr4 when pointed to cpp standard v17 (from v11) does not compile anymore #4910

@Tephilla

Description

@Tephilla

Background:
Been using antlr 4.9.2.2 on windows wsl setup.
My code base previously used cpp 11 and since antlr4 has moved on, I pointed it to cpp17. Now, I cannot make the project and throws an error in the Lexer file.

Issue:
On running make all, I still get the following error. generated/ is the directory that holds all the generated antlr-specific files

g++ -c -w -I /usr/include/antlr4-runtime/ -I generated -std=c++17 generated/*.cpp *.cpp
In file included from generated/DOCLexer.cpp:5:
generated/DOCLexer.h:34:43: error: ‘virtual const std::vector<std::__cxx11::basic_string >& DOCLexer::getTokenNames() const’ marked ‘override’, but does not override

I checked that the antlr4 libraries are present. For instance, my make file points to the following locations which are correct paths.
/usr/include/antlr4-runtime/
/usr/lib/x86_64-linux-gnu/libantlr4-runtime.a

What am I doing wrong? Can someone point me in the right direction to resolve this dependency issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions