Does any one try to build a cpp target? #4085
Unanswered
ReverseJay
asked this question in
Q&A
Replies: 1 comment
-
|
It looks like it's not compiling the generated code and linking it in with your test program. In Visual Studio, you need to add MyOwnLanguageParser.cpp and MyOwnLnaguageLexer.cpp to your project in the Solution Explorer. Right-click on the project, the select in the context menu "Add", and "Add existing". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i download
antlr4-cpp-runtime-4.11.1then use cmake to createLIBANTLR4.sln, buildantlr4_staticwith cpp17 Debug/Release, and i got twoantlr4-runtime-static.lib, then i copy all files inruntime/srcto include file, all static library to lib file, then set my project's configuration:C/C++ -- General -- Additional Include Directories $(SolutionDir)include
C/C++ -- Code Generation --Runtime Library /MTd
Linker -- General -- Additional Library Directories $(SolutionDir)lib
Linker -- Input -- Additional Dependencies antlr4-runtime-static.lib
And I put
#define ANTLR4CPP_STATICon my main.cppAfter that, i write a simple g4 file
then put
-Dlanguage=Cppin command, finally i got a bunch of c filesso my main.cpp is down below
when compile I got link errors
which confused me.
Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions