Search code examples
c++antlrdemo

Error when building the ANTLR4 C++ Demo (macOS Sierra)


When trying to compile and run the antlr4-cpp-demo with Xcode on macOS Sierra I get the following error:

TLexer lexer(&input);    (!) Variable type 'antlrcpptest::TLexer' is an abstract class

As this is a demo I suppose it should work out of the box...

Any idea what is going wrong?


Solution

  • Check what exactly is causing the compiler to believe that TLexer is abstract. Probably it doesn't override a function that is abstract in one of its predecessors, which in turn indicates your are using a code generation jar and a C++ runtime that don't match. Did you download both from the ANTLR website?