I'm trying to build VHDTool on Ubuntu 12.04 but it's failing when linking:
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
The packages uuid-dev and libuuid1 are installed, ¿is there any way to fix the 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
Thanks!
There is a bug in the Makefile. Replace LDFLAGS
with LDLIBS
in the third line.