MinGW GCC 通配符 [英] MinGW GCC wildcard

查看:147
本文介绍了MinGW GCC 通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 windows 上使用 MinGW GCC 编译器如何编译目录中的所有 C 文件.

I'm using MinGW GCC compiler on windows how to compile all C files in a directory.

我用过

gcc  *.c -o  Output

在我输入所需的文件夹后出现此错误

after I entered the required folder and I got this error

gcc: error: *.c: Invalid argument 
gcc: fatal error: no input files

编译终止.

使用的GCC版本是4.7.1

the used version of GCC is 4.7.1

推荐答案

对于像我这样遇到此问题的其他人:

For anyone else like me who's come across this problem:

我在台式机上运行了几年后在平板电脑上安装 MinGW-w64 时遇到了这个问题.
基本上,我有一个 ruby​​ 脚本,它为我做了一些基本的编译工作,它在我的平板电脑上的链接阶段中断了(在桌面上开发并运行良好).
错误:无效参数,没有输入文件(如原始问题).

I ran into this problem when I installed MinGW-w64 on my tablet after having run it for a few years on my desktop.
Basically, I have a ruby script that does some basic compilation stuff for me, and it was breaking at the linking stage on my tablet (developed on, and ran fine on the desktop).
The error: Invalid Argument, no input files (as in the original question).

如果您四处查看,您会发现一些地方告诉您问题是由于 Windows 上的 CMD 处理将通配符传递给程序的方式(与 UNIX shell 相比).
基本上,Windows 将通配符的解释留给程序.
某些 MinGW 版本可以处理来自 CMD 的通配符,而其他版本则不能.
我可以通过 MinGW-W64-builds 安装程序为 MinGW-W64 使用通配符.

If you check around, you'll find a few places that tell you that the issue is due to the way CMD on Windows handles passing wildcards to programs (vs UNIX shells).
Basically Windows leaves interpretation of the wildcard up to the program.
Some builds of MinGW can handle a wildcard from CMD, whereas others won't.
I'm able to use wildcards using the MinGW-W64-builds installer for MinGW-W64.

这篇关于MinGW GCC 通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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