c++ - 是否有独立的 C++ 源代码预处理器?

标签 c++ windows c-preprocessor

<分区>

是否有独立的 C++ 预处理器?我不需要编译器/链接器,而且我无法安装完整的工具包。

我希望能够使用我提供的一些定义和包含路径获得一些 header 的预处理版本。

编辑:我不能依赖任何可用的东西。没有 cl,没有 gcc,什么都没有。我至少需要做的是处理宏(特别是 #ifdef 和 #if )。

编辑:我在 Windows XP 计算机上使用它。

最佳答案

cpp 就是您要找的。不过,我不确定它是否可以在 gcc 发行版之外获得

CPP(1)                                                                 GNU                                                                 CPP(1)

NAME
       cpp - The C Preprocessor

SYNOPSIS
       cpp [-Dmacro[=defn]...] [-Umacro]
           [-Idir...] [-Wwarn...]
           [-M|-MM] [-MG] [-MF filename]
           [-MP] [-MQ target...]
           [-MT target...]
           [-P] [-fno-working-directory]
           [-x language] [-std=standard]
           infile outfile

Only the most useful options are listed here; see below for the remainder.

DESCRIPTION
       The C preprocessor, often known as cpp, is a macro processor that is used automatically by the C compiler to transform your program before
       compilation.  It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs.

关于c++ - 是否有独立的 C++ 源代码预处理器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1645538/

相关文章:

c++ - GLOG 只保存一个文件,第一条消息

windows - Windows Phone 中的动画应用程序图标

c++ - 如何更改宏函数参数扩展顺序?

c-preprocessor - 如何使用 autoconf 为 #define 指定值?

c++ - 用direct2d创建位图图集, "current bitmap"指的是什么?

c++ - 使用硬编码元素初始化 std::vector<MyClass> 的最简单方法是什么?

c++ - Type cv::StereoBM 必须实现继承的纯虚方法

c++ - 多项式代码

c++ - 从命令行应用程序调用 Windows 通用对话框

c - 如何在宏中将可变参数与 printf 一起使用?