加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb

发布时间:2020-12-14 18:53:36 所属栏目:百科 来源:网络整理
导读:Cocos2d-x 3.2最高支持的VS版本为2012,我在VS2013上编译新建立的项目遇到错误: 错误 1 error C1041: 无法打开程序数据库“x:cocos2d-x-3.2projectshellococococos2dexternalchipmunkproj.win32debug.win32vc120.pdb”;如果要将多个 CL.EXE 写入

Cocos2d-x 3.2最高支持的VS版本为2012,我在VS2013上编译新建立的项目遇到错误:

错误 1 error C1041: 无法打开程序数据库“x:cocos2d-x-3.2projectshellococococos2dexternalchipmunkproj.win32debug.win32vc120.pdb”;如果要将多个 CL.EXE 写入同一个 .PDB 文件,请使用 /FS

单个项目解决方案

解决方案是为项目添加/FS (Force Synchronous PDB Writes)编译选项,具体位置在:

一劳永逸的解决方案

直接修改cocos的项目模板templatescpp-template-defaultproj.win32HelloCpp.vcxproj为:

 
 
  1. <?xmlversion="1.0"encoding"utf-8"?>
  2. <ProjectDefaultTargets="Build"ToolsVersion"12.0"xmlns"http://schemas.microsoft.com/developer/msbuild/2003">
  3. <ItemGroupLabel"ProjectConfigurations">
  4. <ProjectConfigurationInclude"Debug|Win32">
  5. <Configuration>Debug</Configuration>
  6. <Platform>Win32</Platform>
  7. </ProjectConfiguration>
  8. "Release|Win32">
  9. Release</Configuration>
  10. </Platform>
  11. </ProjectConfiguration>
  12. </ItemGroup>
  13. <PropertyGroup"Globals"<ProjectGuid>{76A39BB2-9B84-4C65-98A5-654D86B86F2A}</ProjectGuid>
  14. <RootNamespace>test_win32</RootNamespace>
  15. <Keyword>Win32Proj</Keyword>
  16. </PropertyGroup>
  17. <ImportProject"$(VCTargetsPath)Microsoft.Cpp.Default.props"/>
  18. Condition"'$(Configuration)|$(Platform)'=='Release|Win32'""Configuration">
  19. <ConfigurationType>Application</ConfigurationType>
  20. <CharacterSet>Unicode</CharacterSet>
  21. <WholeProgramOptimization>true</WholeProgramOptimization>
  22. <PlatformToolset"'$(VisualStudioVersion)'=='10.0'">v100</PlatformToolset>
  23. "'$(VisualStudioVersion)'=='11.0'"v110</PlatformToolset>
  24. "'$(VisualStudioVersion)'=='11.0'andexists('$(MSBuildProgramFiles32)MicrosoftSDKsWindowsv7.1A')"v110_xp</PlatformToolset>
  25. <PlatformToolset>v120</PlatformToolset>
  26. "'$(Configuration)|$(Platform)'=='Debug|Win32'"</ConfigurationType>
  27. </CharacterSet>
  28. </PlatformToolset>
  29. </PlatformToolset>
  30. </PropertyGroup>
  31. "$(VCTargetsPath)Microsoft.Cpp.props"/>
  32. <ImportGroup"ExtensionSettings">
  33. </ImportGroup>
  34. "PropertySheets""$(UserRootDir)Microsoft.Cpp.$(Platform).user.props""exists('$(UserRootDir)Microsoft.Cpp.$(Platform).user.props')""LocalAppDataPlatform"/>
  35. "..cocos2dcocos2dcocos2dx.props"/>
  36. "..cocos2dcocos2dcocos2d_headers.props"/>
  37. </ImportGroup>
  38. />
  39. />
  40. "UserMacros"/>
  41. <PropertyGroup>
  42. <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
  43. <OutDir"'$(Configuration)|$(Platform)'=='Debug|Win32'"$(SolutionDir)$(Configuration).win32</OutDir>
  44. <IntDir$(Configuration).win32</IntDir>
  45. <LinkIncremental</LinkIncremental>
  46. "'$(Configuration)|$(Platform)'=='Release|Win32'"</OutDir>
  47. </IntDir>
  48. false</LinkIncremental>
  49. <CodeAnalysisRuleSetAllRules.ruleset</CodeAnalysisRuleSet>
  50. <CodeAnalysisRules<CodeAnalysisRuleAssemblies</CodeAnalysisRuleSet>
  51. />
  52. </PropertyGroup>
  53. >
  54. <LibraryPath>$(MSBuildProgramFiles32)MicrosoftSDKsWindowsv7.1Alib;$(LibraryPath)</LibraryPath>
  55. </LibraryPath>
  56. </PropertyGroup>
  57. <ItemDefinitionGroup>
  58. <ClCompile>
  59. <Optimization>Disabled</Optimization>
  60. <AdditionalIncludeDirectories>$(EngineRoot)cocosaudioinclude;$(EngineRoot)external;$(EngineRoot)externalchipmunkincludechipmunk;$(EngineRoot)extensions;..Classes;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  61. <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  62. <MinimalRebuild></MinimalRebuild>
  63. <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
  64. <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  65. <PrecompiledHeader>
  66. </PrecompiledHeader>
  67. <WarningLevel>Level3</WarningLevel>
  68. <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  69. <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  70. <MultiProcessorCompilation></MultiProcessorCompilation>
  71. <AdditionalOptions>/FS%(AdditionalOptions)</AdditionalOptions>
  72. </ClCompile>
  73. <Link>
  74. <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
  75. <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
  76. <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  77. <GenerateDebugInformation></GenerateDebugInformation>
  78. <SubSystem>Windows</SubSystem>
  79. <TargetMachine>MachineX86</TargetMachine>
  80. </Link>
  81. <PostBuildEvent>
  82. <Command>
  83. </Command>
  84. </PostBuildEvent>
  85. <PreLinkEvent>
  86. <Command>ifnotexist"$(OutDir)"mkdir"$(OutDir)"
  87. xcopy/Y/Q"$(EngineRoot)externalwebsocketsprebuiltwin32*.*""$(OutDir)"</Command>
  88. </PreLinkEvent>
  89. </ItemDefinitionGroup>
  90. <ClCompile>
  91. MaxSpeed</Optimization>
  92. <IntrinsicFunctions></IntrinsicFunctions>
  93. </AdditionalIncludeDirectories>
  94. WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  95. MultiThreadedDLL</RuntimeLibrary>
  96. <FunctionLevelLinking></FunctionLevelLinking>
  97. <PrecompiledHeader>
  98. </PrecompiledHeader>
  99. </WarningLevel>
  100. ProgramDatabase</DebugInformationFormat>
  101. </DisableSpecificWarnings>
  102. </MultiProcessorCompilation>
  103. </ClCompile>
  104. <Link>
  105. libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>
  106. </OutputFile>
  107. </AdditionalLibraryDirectories>
  108. </GenerateDebugInformation>
  109. </SubSystem>
  110. <OptimizeReferences></OptimizeReferences>
  111. <EnableCOMDATFolding></EnableCOMDATFolding>
  112. </TargetMachine>
  113. </Link>
  114. <PostBuildEvent>
  115. <Command>
  116. </PostBuildEvent>
  117. <PreLinkEvent>
  118. ifnotexist"$(OutDir)"mkdir"$(OutDir)"
  119. </Command>
  120. </PreLinkEvent>
  121. </ItemDefinitionGroup>
  122. <ItemGroup>
  123. <ClCompile"..ClassesAppDelegate.cpp""..ClassesHelloWorldScene.cpp""main.cpp"<ItemGroup>
  124. <ClInclude"..ClassesAppDelegate.h"/>
  125. "..ClassesHelloWorldScene.h""main.h"</ItemGroup>
  126. <ProjectReference"..cocos2dcocos2dcocos2d.vcxproj"<Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>
  127. <ReferenceOutputAssembly></ReferenceOutputAssembly>
  128. </ProjectReference>
  129. "..cocos2dcocosaudioproj.win32CocosDenshion.vcxproj"{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>
  130. </ProjectReference>
  131. "..cocos2dexternalchipmunkproj.win32chipmunk.vcxproj">
  132. {207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>
  133. </ProjectReference>
  134. </ItemGroup>
  135. <ItemGroup>
  136. <ResourceCompile"game.rc""$(VCTargetsPath)Microsoft.Cpp.targets""ExtensionTargets"</ImportGroup>
  137. </Project>

这样不仅解决了这个问题,还能避免每次开新项目时的强制升级。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读