You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a C++ based project using ANTLR4 Cpp runtime, following the latest documentation.
The project successfully builds and executes under Linux and macOS but fails under Windows when trying to link the executables with the antlr4_static library receiving the following message:
Windows: Windows 10 Pro
MSYS2: MINGW64_NT-10.0-19045 version 3.4.3.x86_64 (runneradmin@fv-az269-587) (gcc version 11.3.0 (GCC) ) 2023-01-17 21:17 UTC
CMake: v3.24.1
ANTLR4 Cpp: v4.12.0
Hi all,
I'm writing a C++ based project using ANTLR4 Cpp runtime, following the latest documentation.
The project successfully builds and executes under Linux and macOS but fails under Windows when trying to link the executables with the antlr4_static library receiving the following message:
Environment:
What I found so far:
It seems like a mismatch between the Cpp runtime build runtime/CMakeLists.txt and the client code build cmake/ExternalAntlr4Cpp.cmake.
CMake recognizes MINGW compiler and set the library prefix/suffix accordingly
Cpp runtime build (runtime/CMakeLists.txt) tests WIN32 to set the static_lib_suffix to '-static' hence producing
libantlr4-runtime-static.a
.Client code (cmake/ExternalAntlr4Cpp.cmake) evaluates MVSC for managing the static library name so searches for
libantlr4-runtime.a
.:this explains the mismatch.
What I do not understand is ... which of the two behaviors is the wrong one?
Personally I solved modifying cmake/ExternalAntlr4Cpp.cmake in this manner:
In this manner it builds and executes correctly but is this the correct way to solve or am I missing something?
Many thanks in advance
Giampiero
The text was updated successfully, but these errors were encountered: