我正在尝试调试编译问题,但我似乎无法获得GCC(或者可能是make ??)来向我展示它正在执行的实际编译器和链接器命令.这是我看到的输出:
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
Run Code Online (Sandbox Code Playgroud)
我想看到的应该与此类似:
$ 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
Run Code Online (Sandbox Code Playgroud)
请注意此示例如何显示完整的gcc命令.以上示例仅显示"CCLD libvirt_parthelper"之类的内容.我不确定如何控制这种行为.
我正在开发一个用Linux上的CMake构建的大型C++项目.CMake运行正常,在模块和应用程序树中生成大量的Makefile.运行GNU make会导致链接器错误.如何make在运行之前打印出确切的命令?
-d选项不会打印命令,但是大量信息没有帮助.
-n选项打印所有命令,但不运行它们,所以我不知道确切的问题是什么.从make -n检查stdout,我没有看到任何相关的命令.我怀疑某些命令会根据早期命令的结果而改变,而Makefiles的层次结构使得很难分辨出真正发生的事情.
我在make的手册页中看不到其他任何看起来有用的选项.
有没有办法在makefile make中手动抑制echo命令@?我在帮助或手册页中找不到这个,只是说"--quiet"做相反的事情.