将 TSS 增强 API 用于项目,但无法编译我的程序。以下是我的项目生成文件。
CC = gcc
CFLAGS = -std=c99 -Wall -I$(IDIR)
IDIR = usr/bin/tss2/
SRCDIR = ./src/
BINDIR = ./bin/
SOURCES = $(SRCDIR)*.c
all: $(BINDIR)antiEvilMaid
$(BINDIR)antiEvilMaid: $(BINDIR)main.o $(BINDIR)errors.o
$(CC) $(BINDIR)main.o $(BINDIR)errors.o -o $@
$(BINDIR)main.o: $(SRCDIR)main.c
$(CC) $(CFLAGS) -c $(SRCDIR)main.c -o $@
$(BINDIR)errors.o: $(SRCDIR)errors.c
$(CC) $(CFLAGS) -c $(SRCDIR)errors.c -o $@
run:
$(BINDIR)antiEvilMaid init
clean:
rm $(BINDIR)*.o $(BINDIR)antiEvilMaid
memtest:
valgrind --leak-check=full $(BINDIR)antiEvilMaid
编译器返回以下错误:
/usr/bin/ld: ./bin/main.o: in function `generateKey':
main.c:(.text+0x136): undefined reference to `Esys_Initialize'
/usr/bin/ld: main.c:(.text+0x163): undefined reference to `Esys_Startup'
/usr/bin/ld: main.c:(.text+0x1f9): undefined reference to `Esys_GetRandom'