1、g++版本要求高于5.0,自己升级g++比较麻烦
2、我直接使用的centos8.0,g++版本为8.以上
3、按照文档解压编译(后面又遇到的问题):
mkdir work
url https://www.antlr.org/download/antlr4-cpp-runtime-4.7.2-source.zip -o ./work/antlr4-cpp-runtime-4.7.2-source.zip
mkdir cpp
cd cpp
unzip ../antlr4-cpp-runtime-4.7.2-source.zip
mkdir build && mkdir run && cd build
cmake .. -DANTLR_JAR_LOCATION=/home/ansible/libs/antlr-4.7.2-complete.jar -DWITH_DEMO=True
make
我没有安装
su
make install
ll /usr/local/include/antlr4-runtime/antlr4-runtime.h
ll /usr/local/lib/libantlr4*
4、遇到找不到uuid,安装uuid(红色部分一定要设置,不然还是找不到)
下载源码安装:http://nchc.dl.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz
解压之后进去配置./configure --prefix=/usr
make
make install