我正在尝试在 Ubuntu 12.04 上构建VHDTool,但链接时失败:
gcc -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2 -c -o vhdtool.o vhdtool.c
gcc -luuid vhdtool.o -o vhdtool
vhdtool.o: In function `vhd_footer':
/root/vhdtool/vhdtool-master/vhdtool.c:456: undefined reference to `uuid_generate'
/root/vhdtool/vhdtool-master/vhdtool.c:457: undefined reference to `uuid_unparse'
collect2: ld returned 1 exit status
make: *** [vhdtool] Error 1
软件包 uuid-dev 和 libuuid1 已安装,¿有没有办法修复 Makefile?
CC := gcc
CFLAGS := -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2
LDFLAGS := -luuid
all: vhdtool
vhdtool: vhdtool.o
vhdtool.o: vhdtool.c
clean:
rm vhdtool vhdtool.o
谢谢!