linux - GCC是否支持命令文件

标签 linux gcc g++ cygwin

MSVC 编译器支持 command files用于传递命令行选项。这主要是由于可以传递给 CreateProcess 的命令行参数的大小受到限制。打电话。

这在 Linux 系统上不是什么大问题,但在执行 Unix 应用程序的 cygwin 端口时,例如 gcc,同样的限制适用。

因此,有谁知道 gcc/g++ 是否也支持某种类型的命令文件?

最佳答案

当然可以!

@file
           Read command-line options from file.  The options read are inserted
           in place of the original @file option.  If file does not exist, or
           cannot be read, then the option will be treated literally, and not
           removed.

           Options in file are separated by whitespace.  A whitespace
           character may be included in an option by surrounding the entire
           option in either single or double quotes.  Any character (including
           a backslash) may be included by prefixing the character to be
           included with a backslash.  The file may itself contain additional
           @file options; any such options will be processed recursively.

如果您的平台有,您也可以使用 xargs 临时装配这种类型的东西。

关于linux - GCC是否支持命令文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7139685/

相关文章:

windows - Windows 7 下 GTK 中 gtk_widget_queue_draw 中的内存泄漏

linux - Yocto 上的 gcc-arm-linux-gnueabihf

C - 教授测试代码中的段错误

c++ - 如何使用 gcc 编译 C++ 代码的特定部分

c++ - 将 C 结构作为 C++ 类访问

linux - 阻止 MPlayer 在 Awesome WM 中使用 float

linux - tcsh 脚本 - 不会使用 cygwin 输出简单的 ls -l 命令

c++ - Linux 上的 .NET Core - 编码(marshal)结构

c++ - clflush 在 i7 中没有给出 const 数据类型的正确答案

c++ - 在 unix 中编译 C++ 时嵌套模板参数出错