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. <?xml version="1.0" encoding="utf-8"?>
  2. <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3. <ItemGroup Label="ProjectConfigurations">
  4. <ProjectConfiguration Include="Debug|Win32">
  5. <Configuration>Debug</Configuration>
  6. <Platform>Win32</Platform>
  7. </ProjectConfiguration>
  8. <ProjectConfiguration Include="Release|Win32">
  9. <Configuration>Release</Configuration>
  10. <Platform>Win32</Platform>
  11. </ProjectConfiguration>
  12. </ItemGroup>
  13. <PropertyGroup Label="Globals">
  14. <ProjectGuid>{76A39BB2-9B84-4C65-98A5-654D86B86F2A}</ProjectGuid>
  15. <RootNamespace>test_win32</RootNamespace>
  16. <Keyword>Win32Proj</Keyword>
  17. </PropertyGroup>
  18. <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  19. <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
  20. <ConfigurationType>Application</ConfigurationType>
  21. <CharacterSet>Unicode</CharacterSet>
  22. <WholeProgramOptimization>true</WholeProgramOptimization>
  23. <PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
  24. <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
  25. <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
  26. <PlatformToolset>v120</PlatformToolset>
  27. </PropertyGroup>
  28. <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
  29. <ConfigurationType>Application</ConfigurationType>
  30. <CharacterSet>Unicode</CharacterSet>
  31. <PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>
  32. <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>
  33. <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>
  34. <PlatformToolset>v120</PlatformToolset>
  35. </PropertyGroup>
  36. <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  37. <ImportGroup Label="ExtensionSettings">
  38. </ImportGroup>
  39. <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
  40. <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  41. <Import Project="..\cocos2d\cocos\2d\cocos2dx.props" />
  42. <Import Project="..\cocos2d\cocos\2d\cocos2d_headers.props" />
  43. </ImportGroup>
  44. <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
  45. <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  46. <Import Project="..\cocos2d\cocos\2d\cocos2dx.props" />
  47. <Import Project="..\cocos2d\cocos\2d\cocos2d_headers.props" />
  48. </ImportGroup>
  49. <PropertyGroup Label="UserMacros" />
  50. <PropertyGroup>
  51. <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
  52. <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
  53. <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>
  54. <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
  55. <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>
  56. <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration).win32\</IntDir>
  57. <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
  58. <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
  59. <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
  60. <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
  61. <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
  62. <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
  63. <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
  64. </PropertyGroup>
  65. <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  66. <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
  67. </PropertyGroup>
  68. <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  69. <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>
  70. </PropertyGroup>
  71. <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
  72. <ClCompile>
  73. <Optimization>Disabled</Optimization>
  74. <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  75. <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>
  76. <MinimalRebuild>false</MinimalRebuild>
  77. <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
  78. <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
  79. <PrecompiledHeader>
  80. </PrecompiledHeader>
  81. <WarningLevel>Level3</WarningLevel>
  82. <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
  83. <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  84. <MultiProcessorCompilation>true</MultiProcessorCompilation>
  85. <AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>
  86. </ClCompile>
  87. <Link>
  88. <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
  89. <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
  90. <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  91. <GenerateDebugInformation>true</GenerateDebugInformation>
  92. <SubSystem>Windows</SubSystem>
  93. <TargetMachine>MachineX86</TargetMachine>
  94. </Link>
  95. <PostBuildEvent>
  96. <Command>
  97. </Command>
  98. </PostBuildEvent>
  99. <PreLinkEvent>
  100. <Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
  101. xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"</Command>
  102. </PreLinkEvent>
  103. </ItemDefinitionGroup>
  104. <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
  105. <ClCompile>
  106. <Optimization>MaxSpeed</Optimization>
  107. <IntrinsicFunctions>true</IntrinsicFunctions>
  108. <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  109. <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USE_MATH_DEFINES;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
  110. <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  111. <FunctionLevelLinking>true</FunctionLevelLinking>
  112. <PrecompiledHeader>
  113. </PrecompiledHeader>
  114. <WarningLevel>Level3</WarningLevel>
  115. <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
  116. <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
  117. <MultiProcessorCompilation>true</MultiProcessorCompilation>
  118. </ClCompile>
  119. <Link>
  120. <AdditionalDependencies>libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>
  121. <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
  122. <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  123. <GenerateDebugInformation>true</GenerateDebugInformation>
  124. <SubSystem>Windows</SubSystem>
  125. <OptimizeReferences>true</OptimizeReferences>
  126. <EnableCOMDATFolding>true</EnableCOMDATFolding>
  127. <TargetMachine>MachineX86</TargetMachine>
  128. </Link>
  129. <PostBuildEvent>
  130. <Command>
  131. </Command>
  132. </PostBuildEvent>
  133. <PreLinkEvent>
  134. <Command>if not exist "$(OutDir)" mkdir "$(OutDir)"
  135. xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"</Command>
  136. </PreLinkEvent>
  137. </ItemDefinitionGroup>
  138. <ItemGroup>
  139. <ClCompile Include="..\Classes\AppDelegate.cpp" />
  140. <ClCompile Include="..\Classes\HelloWorldScene.cpp" />
  141. <ClCompile Include="main.cpp" />
  142. </ItemGroup>
  143. <ItemGroup>
  144. <ClInclude Include="..\Classes\AppDelegate.h" />
  145. <ClInclude Include="..\Classes\HelloWorldScene.h" />
  146. <ClInclude Include="main.h" />
  147. </ItemGroup>
  148. <ItemGroup>
  149. <ProjectReference Include="..\cocos2d\cocos\2d\cocos2d.vcxproj">
  150. <Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>
  151. <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
  152. </ProjectReference>
  153. <ProjectReference Include="..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj">
  154. <Project>{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>
  155. </ProjectReference>
  156. <ProjectReference Include="..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj">
  157. <Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>
  158. </ProjectReference>
  159. </ItemGroup>
  160. <ItemGroup>
  161. <ResourceCompile Include="game.rc" />
  162. </ItemGroup>
  163. <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  164. <ImportGroup Label="ExtensionTargets">
  165. </ImportGroup>
  166. </Project>

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

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

  1. fatal error C1033: 无法打开程序数据库

    转自VC错误:http://www.vcerror.com/?p=1894 问题描述: fatal error C1033: 无法打开程序数据库"" 因为vs2003在window ...

  2. VS2010中:error C2471: 无法更新程序数据库

    Visual Studio 2010环境下 error C2471: 无法更新程序数据库"--.pdb" fatal error C1083: 无法打开程序数据库文件:" ...

  3. 成功解决 _mssql.c(568): fatal error C1083: 无法打开包括文件: “sqlfront.h”: No such file or directory

    成功解决 _mssql.c(568): fatal error C1083: 无法打开包括文件: "sqlfront.h": No such file or directory 目 ...

  4. 解决:mysql报错ERROR 1049 (42000): Unknown database ‘数据库‘

    其实我是犯了一个很严重的错误,报这个错无非就两个原因. 原因一:你的账户密码后面多了一个空格,也就是说你的数据库不对. 解决办法:如果是登录密码的时候就报这个错误,如下图所示: 那么就有可能p和123 ...

  5. 解决idea编译提示: Error:(4, 28) java: 程序包com.xxx.xxx不存在 问题

    问题:idea中通过maven已经导入了包,idea中也能定位到包的位置,但在编译的时候始终报error,找不到包. 原因:idea的版本与maven构建的build不兼容 解决方案: 卸载idea, ...

  6. 成功解决问题LINK : fatal error LNK1181: 无法打开输入文件“m.lib”error: command ‘D:\\Program Files\\Microsoft Visu

    成功解决问题LINK : fatal error LNK1181: 无法打开输入文件"m.lib" error: command 'D:\\Program Files\\Micro ...

  7. 成功解决sub_div.insert(points)cv2.error: OpenCV(3.4.1) C:\projects\opencv-python\opencv\modules\imgproc

    成功解决sub_div.insert(points) cv2.error: OpenCV(3.4.1) C:\projects\opencv-python\opencv\modules\imgproc ...

  8. 成功解决building ‘snappy._snappy‘ extension error: Microsoft Visual C++ 14.0 is required. Get it with “B

    成功解决building 'snappy._snappy' extension error: Microsoft Visual C++ 14.0 is required. Get it with &q ...

  9. 成功解决.sh: line 6: syntax error near unexpected token `do

    成功解决.sh: line 6: syntax error near unexpected token `do 目录 解决问题 解决思路 解决方法 T1.修改格式系统间不兼容的格式

最新文章

  1. python 字符串形式的列表 转 列表
  2. 4位先行进位加法器_行波进位/超前进位加法器详解
  3. P2153 晨跑,费用流裸题
  4. 常用的Homebrew的命令的使用
  5. 【Python基础入门系列】第10天:Python 类与对象
  6. Servlet第三篇【request和response简介、response的常见应用】
  7. 如何使用Restic Backup Client将数据备份到对象存储服务
  8. fmea手册_黄老师与您共读新版FMEA手册07-DFMEA功能分析
  9. 事务四大特性及隔离级别
  10. js 读取外部的本地json文件
  11. php7.1.1一键安装/配置文件简单优化
  12. Android WIFI连接开发 WIFI工具类
  13. 批量给 Word、PPT 和 PDF 插入封面或新的页面
  14. python续行符是啥_python 续行符
  15. C语言 有两个矩形 求重叠面积,计算两个矩形重叠面积的简单方法
  16. Python中__str__的用法
  17. 范数理解(0范数,1范数,2范数)
  18. win10系统无法连接远程服务器,笔者修复win10系统无法连接远程服务器的图文教程...
  19. 计算机组成原理实验一:全加器实验
  20. 【蛮力算法】数据结构与算法

热门文章

  1. vue 自适应屏幕的宽高度
  2. 20221220今天的世界发生了什么
  3. python中print无法打印在控制台输出_Pycharm Python控制台不打印输出
  4. 好多人,微软编程马拉松大赛欲创吉尼斯世界纪录
  5. 第八课--H5内联 SVG
  6. 滴滴发布“五一”劳动节假期安全出行保障公告:应急处置人员24小时轮岗值班...
  7. JavaScript之ES6语法
  8. 《人工智能基础》——线性回归算法推导
  9. 命令模式---电视机遥控器
  10. java年轻代minor gc_jvm之年轻代(新生代)、老年代、永久代以及GC原理详解、GC优化...