是否有独立的C ++源预处理器? [英] Is there a standalone C++ source preprocessor?

查看:104
本文介绍了是否有独立的C ++源预处理器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is there a standalone C++ preprocessor? I don't need the compiler/linker, and I'm not able to install a full kit.

我想要能够获得预处理版本的一些标题,使用一些定义和包括我提供的路径。

I'd like to be able to obtain preprocessed version of some headers, using some defines and include paths I provide.

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

I can't rely on anything being available. No cl, no gcc, nothing. The least I would need done is something that processes macros ( specifically #ifdef and #if ).

编辑:我在Windows XP计算机上使用这个。 p>

I'm using this on a Windows XP computer.

推荐答案

cpp是你要找的。虽然

cpp is what you're looking for. I am not sure if it can be gotten outside of gcc distribution, though

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 ++源预处理器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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