0

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?

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181

1 Answers1

0

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?

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • Hi Mike, Thank you very much for your answer! You where right: I thought I had installed everything from the ANTLR side - but didn't realize that there was still an old homebrew install as well. So the versions of antlr4 and grun I used where actually those from the homebrew install (version 4.6) while all the rest was from the newest version (4.7)... Deinstalling my homebrew version solved the problem and now the demo runs as supposed :) Thank you again, Dietrich – Dietrich Bollmann May 17 '17 at 02:45