使用CMD中的GCC编译器编译目录中的所有.c文件 [英] Compile all .c files in a directory using GCC compiler in CMD

查看:61
本文介绍了使用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".

这篇关于使用CMD中的GCC编译器编译目录中的所有.c文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆