在 CentOS 5.6 中编译 imapfilter 2.4.1 时出错

发布于 2024-12-26 23:12:24 字数 1030 浏览 1 评论 0原文

我正在尝试编译 imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) CentOS 5.6。我相信我已经对所有依赖项进行了排序,但是当我运行 make 时,我得到:

make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2

根据其他用户评论和文件修订日期,我确信这应该编译。我猜我在某个地方缺少图书馆。我将不胜感激我能得到的任何帮助。

I am trying to compile imapfilter 2.4.1 ( https://github.com/lefcha/imapfilter ) in CentOS 5.6. I believe I've got all the dependencies sorted but when I run make I get:

make[1]: Entering directory `/home/src/imapfilter-2.4.1/src'
cc -Wall -O -DMAKEFILE_SHAREDIR='"/usr/local/share/imapfilter"' -c -o core.o core.c
core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’
core.c: In function ‘ifcore_append’:
core.c:947: warning: implicit declaration of function ‘lua_strlen’
core.c: In function ‘luaopen_ifcore’:
core.c:1162: warning: implicit declaration of function ‘luaL_register’
core.c:1162: error: ‘ifcorelib’ undeclared (first use in this function)
core.c:1162: error: (Each undeclared identifier is reported only once
core.c:1162: error: for each function it appears in.)
make[1]: *** [core.o] Error 1
make[1]: Leaving directory `/home/src/imapfilter-2.4.1/src'
make: *** [all] Error 2

Based on other user comments and file revision dates I am sure this should compile. I am guessing I'm missing a library somewhere. I'll appreciate any help I can get on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一桥轻雨一伞开 2025-01-02 23:12:24

从第一条错误消息开始:

core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’

core.c 的第 41 行是:

static const luaL_reg ifcorelib[] = {

来自 gcc 的隐秘消息意味着它对 luaL_reg 是什么一无所知,并且认为它是变量名。然后,当读取同一定义/声明中的第二个变量名称时,它会陷入恐慌。 luaL_reg 应该类似于 struct.

所以,看来你的问题出在LUA开发头文件上。可能是你的 Lua 包太旧甚至太现代了。

imapfilter 的 github 自述文件说:

编译时间要求为Lua(版本5.1)

您确定您的 lua 是 5.1 并且 lua-devel (或任何其他带有 lua 标头的包)也是 5.1 吗?

Starting from first error message:

core.c:41: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ifcorelib’

Line 41 of core.c is:

static const luaL_reg ifcorelib[] = {

Cryptic message from gcc means that it knows nothing about what is the luaL_reg and it thinks that it is variable name. Then it goes into panic when reads second variable name in the same definition/declaration. luaL_reg should be something like struct.

So, it seems that your problems are located in LUA development headers. May be you have too old or even to modern Lua package.

The imapfilter's github's readme says:

Compile time requirements are Lua (version 5.1)

Are you sure that your lua is 5.1 and the lua-devel (or any other package with lua headers) is 5.1 too?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文