试图调试一个编译问题,但总是无法让gcc向我展示正在执行的实际编译器和链接器命令。
下面是输出结果:
CCLD libvirt_parthelper
libvirt_parthelper-parthelper.o: In function `main':
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:102: undefined reference to `ped_device_get'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:116: undefined reference to `ped_disk_new'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:122: undefined reference to `ped_disk_next_partition'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:172: undefined reference to `ped_disk_next_partition'
/root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:172: undefined reference to `ped_disk_next_partition'
collect2: ld returned 1 exit status
make[3]: *** [libvirt_parthelper] Error 1
想看到的应该是类似如下的代码:
$ make
gcc -Wall -c -o main.o main.c
gcc -Wall -c -o hello_fn.o hello_fn.c
gcc main.o hello_fn.o -o main
发布于 2017-12-29 10:28:16
可以调用这个试试
make -n
发布于 2017-12-29 12:22:16
makefile,由自动工具生成(./configure
)通常有一个详细的选项
所以基本上,使用make VERBOSE=1
或make V=1
应该可以给你完整的命令。
但这也取决于生成Makefile的方式。
发布于 2017-12-29 12:54:56
make SHELL='sh -x'
Makefile 样本
:
a:
@echo a
输出:
+ echo a
a
https://stackoverflow.com/questions/-100001314
复制相似问题