问题描述
当我运行make binutils/readelf
时,出现以下错误:
When I run make binutils/readelf
I get the following error:
In file included from readelf.c:43:0:
sysdep.h:23:25: fatal error: alloca-conf.h: No such file or directory
#include "alloca-conf.h"
我缺少什么依赖性?我该如何构建和编译readelf而不使用其余的binutils?
What dependency am I missing? How do I just build and compile readelf without making the rest of binutils?
推荐答案
实际上发生的是您没有Makefile
或至少没有一个定义binutils/readelf
的目标.但是,由于存在一个binutils/readelf.c
文件,make仍然运行并尝试使用其隐式模式规则来编译和链接binutils/readelf
...并失败了,因为如果没有相应的配置就无法生成该源文件.
What has actually happened is that you do not have a Makefile
or at least not one defining binutils/readelf
target. But since there is a binutils/readelf.c
file, make still ran and tried to compile and link binutils/readelf
using its implicit pattern rules... and failed because this source file cannot be built without corresponding configuration.
这只是添加更多细节.长话短说,按照注释中的建议运行./configure
和make
并收集生成的readelf
.然后,尝试从基于自动工具的项目中隔离出单独的项目要容易得多.将-I
添加到CFLAGS
以找到alloca-conf.h
,您将遇到另一个类似的问题.
This is just to add a bit more detail. Long story short, run ./configure
and make
as suggested in the comments and collect your resulting readelf
. Much easier then trying to isolate a solitary item build out of autotools based project. You add -I
to CFLAGS
to find alloca-conf.h
, you'll just run into another problem like that.
这篇关于binutils使readelf出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!