我正在尝试编译 BFLT Utils (https://github.com/nihilus/bflt-utils),但不断出现以下错误:
$:/tmp/bflt-utils/flthdr# make
gcc -Wall -g -O2 compress.c -c
gcc -Wall -g -O2 stubs.c -c
gcc -Wall -g -O2 flthdr.c -c
flthdr.c:22:23: fatal error: libiberty.h: No such file or directory
#include <libiberty.h>
^
compilation terminated.
Makefile:16: recipe for target 'flthdr.o' failed
make: *** [flthdr.o] Error 1
我已经安装libiberty-dev
使用apt-get install libiberty-dev
.并使用find / -name libiberty.*
收益率:
/usr/include/libiberty/libiberty.h
我尝试修改 Makefile 以使用以下命令添加路径:
CC=gcc
CFLAGS=-Wall -g -O2 -L/usr/include/libiberty
LDFLAGS=-lz -lc -lbfd -liberty
TARGET=flthdr
$(TARGET): compress.o stubs.o flthdr.o
$(CC) $(CFLAGS) -o $(TARGET) *.o $(LDFLAGS)
compress.o:
$(CC) $(CFLAGS) compress.c -c
stubs.o:
$(CC) $(CFLAGS) stubs.c -c
flthdr.o:
$(CC) $(CFLAGS) flthdr.c -c
clean:
rm -f *.o $(TARGET)
但我仍然遇到同样的错误。
为什么找不到头文件?