当我直觉地尝试运行这样的命令时
cc -c source.c header.h -o a_name_different_than_source.o
抛出以下错误
cc: cannot specify -o with -c, -S or -E with multiple files
最佳答案
不要将 header.h
放入命令行中:
cc -c source.c -o a_name_different_than_source.o
会起作用的。
关于c - 如何指定目标文件的名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15454867/