请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 8720|回复: 6

antlr安装问题

[复制链接]

新浪微博达人勋

发表于 2016-5-13 05:26:34 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 网络小丁丁 于 2016-5-13 06:09 编辑

今天编译ANTLR的时候遇到这么一个报错

In file included from /root/Tools/antlr-2.7.7/lib/cpp/src/../../../lib/cpp/src/CharScanner.cpp:10:0:
/root/Tools/antlr-2.7.7/scripts/../lib/cpp/antlr/CharScanner.hpp:474:30: error:EOF’ was not declared in this scope
  static const int EOF_CHAR = EOF;
                              ^
/root/Tools/antlr-2.7.7/scripts/../lib/cpp/antlr/CharScanner.hpp: In member function ‘bool antlr::CharScannerLiteralsLess::operator()(const string&, const string&) const’:
/root/Tools/antlr-2.7.7/scripts/../lib/cpp/antlr/CharScanner.hpp:565:41: error:strcasecmp’ was not declared in this scope
   return (strcasecmp(x.c_str(),y.c_str())<0);
                                         ^

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                      >> E R R O R <<
============================================================

g++  -c  -I . -I /root/Tools/antlr-2.7.7/scripts/../lib/cpp /root/Tools/antlr-2.7.7/lib/cpp/src/../../../lib/cpp/src/CharScanner.cpp

============================================================
Got an error while trying to execute  command  above.  Error
messages (if any) must have shown before. The exit code was:
exit(1)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
make[3]: *** [/root/Tools/antlr-2.7.7/lib/cpp/src/CharScanner.o] Error 1
make[3]: Leaving directory `/root/Tools/antlr-2.7.7/lib/cpp/src'
make[2]: *** [all] Error 1
make[2]: Leaving directory `/root/Tools/antlr-2.7.7/lib/cpp'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/root/Tools/antlr-2.7.7/lib'
make: *** [all] Error 1

这个问题怎么解决,是不是什么库没有装
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2021-2-13 08:49:52 | 显示全部楼层
前两天也遇到了这个问题,把解决方案说一下。
terminal切到antlr安装包目录下,键入

vi lib/cpp/antlr/CharScanner.hpp

把文件里这一行

#include <antlr/config.hpp>

替换为

#include <fstream>
#include <strings.h>  
#include <antlr/config.hpp>
#ifndef EOF
    #define EOF     std::ifstream::traits_type::eof()
#endif
密码修改失败请联系微信:mofangbao
回复 支持 1 反对 0

使用道具 举报

新浪微博达人勋

发表于 2018-4-12 19:37:41 | 显示全部楼层
请问您这个问题最后是怎么解决的
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-12-1 16:03:46 | 显示全部楼层
请问您这个问题怎么解决的当时?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-3-10 17:54:14 | 显示全部楼层
按照你的方案,解决了相同的问题,非常感谢!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-3-10 17:57:00 | 显示全部楼层
weilin421 发表于 2021-2-13 08:49
前两天也遇到了这个问题,把解决方案说一下。
terminal切到antlr安装包目录下,键入


按照你的方案,解决了相同的问题,非常感谢!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2023-8-24 14:44:35 | 显示全部楼层
weilin421 发表于 2021-2-13 08:49
前两天也遇到了这个问题,把解决方案说一下。
terminal切到antlr安装包目录下,键入

感谢,成功
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表