C++生成预处理输出后构建(VS 08)

发布于 2024-10-15 17:23:41 字数 463 浏览 2 评论 0原文

我注意到,当我选择

Project Properties -> Configuration Properties -> c/c++ -> Preprocessor -> 
     Generate Proprocessed file -> With Line Numbers (/P)

(以及生成预处理文件的其他选项)时,不会创建目标文件,因此构建失败。就好像右手不知道左手在做什么,所以出现错误:

LINK:致命错误 LNK1104:无法打开文件“.\Debug\globals.obj”

这让我认为可能可以使用命令行 /P 创建目标文件。是否可以?我可以使用 \P 获取目标文件吗?我在某处读到了我看不到的内容,但我想将其发布到 Stack Overflow 社区。

I noticed that when I select

Project Properties -> Configuration Properties -> c/c++ -> Preprocessor -> 
     Generate Proprocessed file -> With Line Numbers (/P)

(and other options that generate preprocessed file), no object file is created, so the build fails. It's like the right hand doesn't know what the left is doing, so there's an error:

LINK : fatal error LNK1104: cannot open file '.\Debug\globals.obj'

That makes me think that it might be the case that an object file can be created with command-line /P. Is it possible? Can I get object files with \P? I read somewhere that I can't, but I would like to put it to the Stack Overflow community.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贪了杯 2024-10-22 17:23:41

/P 开关的定义是: 预处理不编译或链接

所以,看起来没有办法做你想做的事。 (这并不奇怪。/P 的输出往往相当大,我怀疑大多数人会希望为每个构建生成它。)

The definition of the /P switch is: Preprocess without compiling or linking.

So, it doesn't look like there's a way of doing what you'd like to do. (This isn't surprising. The output from /P tends to be rather large, and I doubt that most folks would want to have it generated for every build.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文