C++生成预处理输出后构建(VS 08)
我注意到,当我选择
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
/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.)