zoukankan      html  css  js  c++  java
  • 2016-07-07: 重新编译时vc90.pdb不是创建此预编译头时使用的pdb文件

    使用VS2008在一个解决方案中包含多个项目时,当设置多个项目的中间目录为同一个目录时,在增量编译时出现“重新编译时vc90.pdb不是创建此预编译头时使用的pdb文件,请重新创建预编译头问题”,从而导致整个解决方案每次都必须重新全部生成。

    在msdn上获得如下信息:

    You may receive a "PRJ0008" or "C2471" or "C1083" or "D8022" or "LNK1103" or similar error message when you try to build a solution in Visual C++

    Symptoms:

    • D8022 : Cannot open 'RSP00000215921192.rsp'
    • PRJ0008 : Could not delete file 'vc90.idb'.
    • C1083 : Cannot open program database file 'vc90.pdb'
    • C2471 : Cannot update program database 'vc90.pdb'
    • LNK1103 : debugging information corrupt.

    Cause:

    This problem occurs when all of the following conditions are true:

    1. You have a solution with more than one project in it.
    2. Two or more of the projects are not dependent on each other.
    3. You have parallel builds enabled. (Tools -> Options: Projects and Solutions, Build and Run: "maximum number of parallel project builds" is set to a value greater than 1)
    4. You are building on a system with multiple CPUs (cores).
    5. Two or more of the non-dependent projects are configured to use the same Intermediate and/or Output directory.
    6. A specific race condition in mspdbsrv.exe remains uncorrected.

    Resolution:

    To resolve the problem do one or more of the following:

    • Reconfigure the non-dependent projects to specify an Intermediate and Output directory that is different from one another, e.g. Output Directory = "$(SolutionDir)$(ProjectName)$(ConfigurationName)", Intermediate Directory = "$(OutDir)".
    • Adjust your solution's project dependencies (Project -> Project Dependencies...) so that each is dependent on another.
    • Disable parallel builds.
    • Add the "/onecpu" boot option to your boot.ini file.
    • Change you BIOS settings to enable/use only one CPU.
    • File a problem report with Microsoft Technical Support and keep bugging the ____ out of them until they eventually fix mspdbsrv.

    Status:

    The problem is a combination of both a user project configuration error as well as a race condition in Microsoft's "mspdbsrv.exe" utility that does not properly handle more than one thread calling it at the same time for the same file resulting in the file's HANDLE being left open.

    Additionally Visual Studio itself and/or its build system (VCBUILD and/or MSBUILD) (or all three!) should be made smart enough to detect and alert the user of such user errors so that corrective action can be taken.

    This problem has been around for a LOOOOOONG time.

    Applies to:

    • Microsoft Visual C++ 2005
    • Microsoft Visual C++ 2008
    • Others?

    Respectfully submitted:

       "Fish" (David B. Trout)
    fish@infidels.org

    p.s:

       You're welcome. :)


    Fish (David B. Trout)

    最后,通过重新配置项目的中间输出目录成功解决上述问题。

    遗留问题:在每个项目生成时,在对应的中间目录下都会生成vc90.pdb以及vc90.idb文件,如果全部项目的中间目录配置成相同目录,在项目依次生成过程中,后面生成的pdb文件会覆盖前面生成的pdb文件,从而导致修改部分源代码时,pdb文件可能不再是其对应项目生成的文件,因此需要重新生成整个解决方案。纯属猜测,后续可以使用逐步生成项目的方式验证结论。

     

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/25731965-bf98-4bb7-97b7-6d1a0b21b733/cant-open-vc90pdb-in-visual-c-2008-rebuild?forum=vcgeneral

  • 相关阅读:
    idea配置tomcat运行按钮置灰,下拉没有自定义的tomcat选项
    配置多版本jdk,自由切换jdk版本
    五年经验程序员告诉你,如何确定自己是否适合做程序员
    你的编程能力从什么时候开始突飞猛进?
    10 个提升效率的Linux小技巧
    8 种经常被忽视的 SQL 错误用法,你有没有踩过坑?
    十大优秀编程项目,让你的简历金光闪闪
    一文掌握 Lambda 表达式
    一文详解微服务架构(一)
    Java的参数传递是「按值传递」还是「按引用传递」?
  • 原文地址:https://www.cnblogs.com/zhouLee/p/5650781.html
Copyright © 2011-2022 走看看