首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在x86_64上编译"fortune“时出错

在x86_64上编译"fortune“时出错
EN

Stack Overflow用户
提问于 2013-05-31 05:02:21
回答 3查看 241关注 0票数 0

我用的是x86_64机器。我试图使用它的makefile来构建fortune,但是我得到了一个关于缺少符号的错误:

代码语言:javascript
复制
cd fortune && make CC='gcc' \
                    CFLAGS='-O2 -DFORTDIR="\"/usr/local/share/games/fortunes\"" -DOFFDIR="\"/usr/local/share/games/fortunes/off\"" -Wall -fomit-frame-pointer -pipe -DHAVE_REGEX_H -DBSD_REGEX -I../util'   \
                    LDFLAGS='-s' LIBS=''
gcc -s -o fortune fortune.o 
ld: warning: option -s is obsolete and being ignored
Undefined symbols for architecture x86_64:
  "_re_comp", referenced from:
      _getargs in fortune.o
  "_re_exec", referenced from:
      _matches_in_list in fortune.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [fortune] Error 1
make: *** [fortune-bin] Error 2

如果我尝试为x86主机构建,则会得到相同的错误:

代码语言:javascript
复制
terences-imac:fortune-mod-9708 MAU$ make host=x86
cd fortune && make CC='gcc' \
                    CFLAGS='-O2 -DFORTDIR="\"/usr/local/share/games/fortunes\"" -DOFFDIR="\"/usr/local/share/games/fortunes/off\"" -Wall -fomit-frame-pointer -pipe -DHAVE_REGEX_H -DBSD_REGEX -I../util'   \
                    LDFLAGS='-s' LIBS=''
gcc -s -o fortune fortune.o 
ld: warning: option -s is obsolete and being ignored
Undefined symbols for architecture x86_64:
  "_re_comp", referenced from:
      _getargs in fortune.o
  "_re_exec", referenced from:
      _matches_in_list in fortune.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [fortune] Error 1
make: *** [fortune-bin] Error 2`
EN

回答 3

Stack Overflow用户

发布于 2014-01-22 00:02:47

显然,您正在尝试在Mac上编译,使用标签"osx“和主机名"terences-imac”……

据我所知,最初的财富(ftp://metalab.unc.edu/pub/Linux/games/amusements/fortune/)只针对Linux。

有一些BSD端口,你可以查看:https://github.com/ArrantSquid/Fortune-OSX,它在OSX10.9上为我工作(点击所有)

票数 2
EN

Stack Overflow用户

发布于 2013-05-31 07:45:21

这就是为什么,当人们抱怨汽车工具时,你应该忽略它们。记住,自动工具是为用户准备的,而不是为维护人员准备的。

您不需要指定您正在构建的操作系统。但是,缺少的符号与正则表达式解析有关,并且在makefile中设置了-DBSD_REGEX。如果您不在BSD系统上,这可能是问题的一部分。

如果您使用的是GNU/Linux,那么请查看re_comp手册页,我看到它推荐:

代码语言:javascript
复制
#define _REGEX_RE_COMP

因此您可以尝试将-D_REGEX_RE_COMP添加到编译行中。

票数 0
EN

Stack Overflow用户

发布于 2020-09-06 16:28:55

目前在github上有一个Mac财富端口的分支,已经被改编成64位版本。

https://github.com/tristanmorgan/Fortune-OSX/tree/sixty-four-bit

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16847476

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档