使用CMD中的GCC编译器编译目录中的所有.c文件
问题描述:
是否可以通过在GCC编译器中使用命令行来编译给定文件夹中的所有 .c
文件?
我已经在Linux上看到此页面:http://www.commandlinefu.com/commands/view/3230/compile-all-c-files-in-a-directory ,但找不到与CMD等效的任何内容.
Is there a way to compile all .c
files in a given folder by using the command line with GCC compiler ?
I've seen this page for Linux : http://www.commandlinefu.com/commands/view/3230/compile-all-c-files-in-a-directory but couldn't find any equivalent for CMD.
答
我想gcc本身没有这样的参数.
I guess gcc itself doesn't have such a parameter.
但是您可以尝试 gcc * .c -o Output
的常规通配符参数,其中 *
(通配符)应读为"any".
But you can try the regular wildcard argument of gcc *.c -o Output
where the *
(wildcard) is to read as "any".