C++ runtime demo fails to build
See original GitHub issueIn the current state of the master branch (dd623ec), the C++ runtime demo fails to build:
$ cd <snip>/runtime/Cpp
$ mkdir build && mkdir run && cd build
$ cmake .. -DANTLR_JAR_LOCATION=<snip>/antlr-4.9.3-complete.jar -DWITH_DEMO=True
$ make
...
[ 97%] Building CXX object demo/CMakeFiles/antlr4-demo.dir/Linux/main.cpp.o
In file included from /home/felix/src/antlr4/runtime/Cpp/demo/Linux/main.cpp:16:
/home/felix/src/antlr4/runtime/Cpp/demo/generated/TLexer.h:57:43: error: ‘virtual const std::vector<std::__cxx11::basic_string<char> >& antlrcpptest::TLexer::getTokenNames() const’ marked ‘override’, but does not override
57 | virtual const std::vector<std::string>& getTokenNames() const override; // deprecated, use vocabulary instead
| ^~~~~~~~~~~~~
In file included from /home/felix/src/antlr4/runtime/Cpp/demo/Linux/main.cpp:17:
/home/felix/src/antlr4/runtime/Cpp/demo/generated/TParser.h:44:43: error: ‘virtual const std::vector<std::__cxx11::basic_string<char> >& antlrcpptest::TParser::getTokenNames() const’ marked ‘override’, but does not override
44 | virtual const std::vector<std::string>& getTokenNames() const override { return _tokenNames; }; // deprecated: use vocabulary instead.
| ^~~~~~~~~~~~~
make[2]: *** [demo/CMakeFiles/antlr4-demo.dir/build.make:97: demo/CMakeFiles/antlr4-demo.dir/Linux/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:414: demo/CMakeFiles/antlr4-demo.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
There’s also a new warning:
[ 12%] Building CXX object runtime/CMakeFiles/antlr4_shared.dir/src/Vocabulary.cpp.o
/home/felix/src/antlr4/runtime/Cpp/runtime/src/Vocabulary.cpp: In static member function ‘static void antlr4::dfa::Vocabulary::__static_initialization_and_destruction_0(int, int)’:
/home/felix/src/antlr4/runtime/Cpp/runtime/src/Vocabulary.cpp:12:18: warning: ‘antlr4::dfa::Vocabulary::EMPTY_VOCABULARY’ is deprecated: Use the default constructor of Vocabulary instead. [-Wdeprecated-declarations]
12 | const Vocabulary Vocabulary::EMPTY_VOCABULARY;
| ^~~~~~~~~~
/home/felix/src/antlr4/runtime/Cpp/runtime/src/Vocabulary.cpp:12:18: note: declared here
@jcking / @mike-lischke - I’m naively assuming this is related to one of your recent PRs. Could you please take a look? I haven’t spent the time to narrow down when exactly the error was introduced, but I can if you want me to.
Versions:
-- The C compiler identification is GNU 11.2.1
-- The CXX compiler identification is GNU 11.2.1
$ gcc --version
gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)
$ java --version
openjdk 11.0.13 2021-10-19
OpenJDK Runtime Environment 18.9 (build 11.0.13+8)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top Results From Across the Web
ANLTR4 Cpp demo fails to run because of a __gthread problem
I have compiled ANTLR4 runtime in a VirtualBox Ubuntu 20.04, with g++ 9.4.0. I want to learn how to integrate the ANTLR tool...
Read more >Fix Microsoft Visual C++ Runtime Library Assertion Failed ...
How to Fix Adobe Microsoft Visual C++ Runtime Library Assertion Failed Vulcanadapter.cc Error on Windows 10/11Step 1) Install Visual C++ ...
Read more >ARM Runtime Library does not build automatically - TI E2E
Hi, We have tried to change Code Generation Tools for Sitara from V5.0.5 to V5.2.5. At the end of the rebuild the linker...
Read more >Upgrade in C++ runtime from 14.25.28610 to 14.27.29110 ...
Chromium compile error when I upgraded vs2019 windows from 16.5 to 16.7. ... error: expected ')' C:\Program Files (x86)\Microsoft Visual ...
Read more >Difference between Compile Time Errors and Runtime Errors ...
Difference between Compile Time Errors and Runtime Errors in C Program - Error or exception is something that refers to the interruption of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Probably not related, but I got this error when running with the
CMakeLists.txt
in the README:I had to add:
I was only able to find that because I enabled debugging with
set(CMAKE_CXX_FLAGS "-g")
and stepped through the code. So I guess that’s also useful to include - but this is also my first CPP project.