【问题标题】:VS2008 project only compiles 1 C++ file in x64 targetVS2008 项目仅在 x64 目标中编译 1 个 C++ 文件
【发布时间】:2011-09-29 16:43:15
【问题描述】:

这很奇怪,因为大多数情况下它都能很好地编译所有东西,但是这个项目(主 DLL 项目,它链接到许多库项目中)只是拒绝。它只编译 CK20_Test.cpp,然后继续链接。如果我排除那个,它只编译 DebugInfo.cpp 和链接。等等。

如果我切换到 Win32 目标,它编译一切正常。

Microsoft Visual Studio 2008 版本 9.0.21022.8 RTM, 微软 .NET 框架, 版本 3.5 SP1, 微软 Visual C++ 2008 91605-130-0691883-60531

并安装了一堆标准修补程序。

1>------ Rebuild All started: Project: XMD, Configuration: DebugR x64 ------
1>Deleting intermediate and output files for project 'XMD', configuration 'DebugR|x64'
1>Compiling...
1>stdafx.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>LINK : D:\prj\alpha\64\shared\x64\DebugR\XMDCore.dll not found or not built by the last incremental link; performing full link
1>Embedding manifest...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Build log was saved at "file://d:\prj\alpha\64\shared\xmd\x64\DebugR\BuildLog.htm"
1>XMD - 0 error(s), 0 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

编辑:配置另一台计算机。同样的问题。我觉得项目文件必须被破坏(见我下面关于内容的评论),或者编译器搞砸了。但我无法想象我会做些什么来解开它。

【问题讨论】:

  • 你能发布你构建的控制台输出吗?还是你的构建日志?
  • 附加重建(仅限项目)日志。
  • 你说它编译CK20_Test.cpp,但我在构建日志中没有看到它......
  • "DebugR" 很不寻常。这是故意的吗?
  • 尝试在文本编辑器中打开 vcproj 文件——您可能有一些在 64 位配置中设置不同的选项

标签: visual-studio-2008 visual-c++ compilation 64-bit


【解决方案1】:

问题解决了! C++ 输出文件对象文件名设置 (/Fo) 为 $(IntDir)。

当我在 x64 中编译时,程序生成了 DebugR.obj。 在 Win32 编译器中,相同的设置生成 DebugR\$(InputName).obj。

对于发布或调试配置也是如此。

解决方法:将 $(IntDir) 改为 $(IntDir)\

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-14
    • 2012-02-06
    • 1970-01-01
    • 2011-02-27
    • 2015-07-07
    • 1970-01-01
    • 2016-03-10
    • 2012-12-02
    相关资源
    最近更新 更多