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

前端之家收集整理的这篇文章主要介绍了解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

错误 1 error C1041: 无法打开程序数据库“x:\cocos2d-x-3.2\projects\hellococo\cocos2d\external\chipmunk\proj.win32\debug.win32\vc120.pdb”;如果要将多个 CL.EXE 写入同一个 .PDB 文件,请使用 /FS

单个项目解决方

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

一劳永逸的解决方

直接修改cocos的项目模板templates\cpp-template-default\proj.win32\HelloCpp.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)\MicrosoftSDKs\Windows\v7.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. "..\cocos2d\cocos\2d\cocos2dx.props"/>
  36. "..\cocos2d\cocos\2d\cocos2d_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)\MicrosoftSDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
  55. </LibraryPath>
  56. </PropertyGroup>
  57. <ItemDefinitionGroup>
  58. <ClCompile>
  59. <Optimization>Disabled</Optimization>
  60. <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(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)external\websockets\prebuilt\win32\*.*""$(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"..\Classes\AppDelegate.cpp""..\Classes\HelloWorldScene.cpp""main.cpp"<ItemGroup>
  124. <ClInclude"..\Classes\AppDelegate.h"/>
  125. "..\Classes\HelloWorldScene.h""main.h"</ItemGroup>
  126. <ProjectReference"..\cocos2d\cocos\2d\cocos2d.vcxproj"<Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>
  127. <ReferenceOutputAssembly></ReferenceOutputAssembly>
  128. </ProjectReference>
  129. "..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj"{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>
  130. </ProjectReference>
  131. "..\cocos2d\external\chipmunk\proj.win32\chipmunk.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>

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

原文链接:https://www.f2er.com/cocos2dx/340546.html

猜你在找的Cocos2d-x相关文章