1

我尝试根据此链接http://linuxdrops.com/log-management-using-logstash-and-kibana-on-centos-rhel-fedora/编译 grok,但遇到以下问题。希望有人可以帮助我解决我遇到的问题。

[root@eul2400508 grok]# make 
cc -c -pipe -fPIC -I. -O2 -I/usr/local/include -DPLATFORM_GNULinux  grok.c -o grok.o
In file included from grok.c:1:
grok.h:8:20: error: tcutil.h: No such file or directory
In file included from grok.c:1:
grok.h:39: error: expected specifier-qualifier-list before ‘TCTREE’
In file included from grok.h:132,
                 from grok.c:1:
grok_pattern.h:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from grok.h:140,
                 from grok.c:1:
grok_discover.h:9: error: expected specifier-qualifier-list before ‘TCTREE’
grok.c: In function ‘grok_init’:
grok.c:27: error: ‘grok_t’ has no member named ‘re’
grok.c:30: error: ‘grok_t’ has no member named ‘pcre_capture_vector’
grok.c:31: error: ‘grok_t’ has no member named ‘pcre_num_captures’
grok.c:32: error: ‘grok_t’ has no member named ‘max_capture_num’
grok.c:33: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:34: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:35: error: ‘grok_t’ has no member named ‘logmask’
grok.c:36: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:39: error: ‘grok_t’ has no member named ‘patterns’
grok.c:43: error: ‘grok_t’ has no member named ‘captures_by_id’
grok.c:44: error: ‘grok_t’ has no member named ‘captures_by_name'
grok.c:45: error: ‘grok_t’ has no member named ‘captures_by_subname’
grok.c:46: error: ‘grok_t’ has no member named ‘captures_by_capture_number’
grok.c:56: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:57: error: ‘grok_t’ has no member named ‘pcre_erroffset’
[root@eul2400508 grok]# make 
cc -c -pipe -fPIC -I. -O2 -I/usr/local/include -DPLATFORM_GNULinux  grok.c -o grok.o
In file included from grok.c:1:
grok.h:8:20: error: tcutil.h: No such file or directory
In file included from grok.c:1:
grok.h:39: error: expected specifier-qualifier-list before ‘TCTREE’
In file included from grok.h:132,
                 from grok.c:1:
grok_pattern.h:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from grok.h:140,
                 from grok.c:1:
grok_discover.h:9: error: expected specifier-qualifier-list before ‘TCTREE’
grok.c: In function ‘grok_init’:
grok.c:27: error: ‘grok_t’ has no member named ‘re’
grok.c:30: error: ‘grok_t’ has no member named ‘pcre_capture_vector’
grok.c:31: error: ‘grok_t’ has no member named ‘pcre_num_captures’
grok.c:32: error: ‘grok_t’ has no member named ‘max_capture_num’
grok.c:33: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:34: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:35: error: ‘grok_t’ has no member named ‘logmask’
grok.c:36: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:39: error: ‘grok_t’ has no member named ‘patterns’
grok.c:43: error: ‘grok_t’ has no member named ‘captures_by_id’
grok.c:44: error: ‘grok_t’ has no member named ‘captures_by_name'
grok.c:45: error: ‘grok_t’ has no member named ‘captures_by_subname’
grok.c:46: error: ‘grok_t’ has no member named ‘captures_by_capture_number’
grok.c:56: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:57: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c:60: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:62: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c: In function ‘grok_clone’:
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c: In function ‘grok_pcre_callout’:
grok.c:114: error: ‘grok_t’ has no member named ‘logmask’
grok.c:114: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:119: error: ‘grok_t’ has no member named ‘logmask’
grok.c:119: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:124: error: ‘grok_t’ has no member named ‘logmask’
grok.c:124: error: ‘grok_t’ has no member named ‘logdepth’
make: *** [grok.o] Error 1
grok.c:60: error: ‘grok_t’ has no member named ‘pcre_errptr’
grok.c:62: error: ‘grok_t’ has no member named ‘pcre_erroffset’
grok.c: In function ‘grok_clone’:
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:78: error: ‘grok_t’ has no member named ‘patterns’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:79: error: ‘grok_t’ has no member named ‘logmask’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:80: error: ‘grok_t’ has no member named ‘logdepth’
grok.c: In function ‘grok_pcre_callout’:
grok.c:114: error: ‘grok_t’ has no member named ‘logmask’
grok.c:114: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:119: error: ‘grok_t’ has no member named ‘logmask’
grok.c:119: error: ‘grok_t’ has no member named ‘logdepth’
grok.c:124: error: ‘grok_t’ has no member named ‘logmask’
grok.c:124: error: ‘grok_t’ has no member named ‘logdepth’
make: *** [grok.o] Error 1
4

3 回答 3

2

有同样的问题,但在 debian 上并且能够通过以下方式解决:

  1. 确保我拥有所有依赖项:在 Makefile 中找到 - 第 269 行

    • 野牛
    • ctags
    • 柔性
    • gperf
    • libevent-dev
    • libpcre3-dev
    • libtokyocabinet-dev
  2. 我也按照我在“wheel ...@gmail.com”的评论中找到的说明进行操作,但不确定这是否有必要。

可以通过更改如下所示的两条 gcc 行来修复 Makefile:

gcc $(LDFLAGS) $^ -o $@

对此:

gcc $^ $(LDFLAGS) -o $@

当然,更新 CFLAGS 和 LDFLAGS 以指向正确的目录。

于 2013-10-04T16:58:10.650 回答
0

在 Centos 上,您需要使用相同的软件包,尽管它们的名称不同(只是最后三个):

bison
ctags
flex
gperf
libevent-devel
libprcre3-devel
tokyocabinet-dev
于 2014-12-16T22:41:28.843 回答
0

make grokUbuntu 12.04 上,我需要更新上面提到的两条 gcc 行(通过在 $^ 之后移动 $(LDFLAGS)),但似乎我不需要做任何这意味着:

“更新 CFLAGS 和 LDFLAGS 以指向正确的目录。”

于 2014-07-07T06:07:47.193 回答