单个项目解决方案

解决方案是为项目添加 /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. error C2471: 无法更新程序数据库 vc90.pdb

    error C2471: 无法更新程序数据库“d:/Work/ Project/debug/vc90.pdb” fatal error C1083: 无法打开程序数据库文件:“d:/Work/ Pro ...

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

    这段时间在使用VS做一个项目.在使用过程中,今天遇到了一个问题,也就是题目所说的那样: error C2471: 无法更新程序数据库.之后在网上搜了一下,得到了两种解决方案,两种方案分别如下: (一) ...

  3. Visual Studio 下error C2471: 无法更新程序数据库

    转载请注明来源:https://www.cnblogs.com/hookjc/ 解决方案:修改项目属性 右击项目 --> "属性" 1. "C/C++" ...

  4. 完美解决VS2003.Net fatal error LNK1201: 写入程序数据库“.pdb”时出错

    我的开发环境是Win7旗舰64位+VS2003.Net,经常卡pdb错误,文末给出一个完美的解决方案和一个懒人补丁包.问题描述如下:在重新编译的时候,经常报错: fatal error LNK1201 ...

  5. 解决:fatal error LNK1104: 无法打开文件“libc.lib”

    今天使用VS2017编译比较老的VC++项目,出现了[fatal error LNK1104: 无法打开文件“libc.lib”]的链接器问题,解决方法如下: 项目->属性中->配置属性- ...

  6. 【转载】重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    重置密码解决MySQL for Linux错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using passwor ...

  7. 解决 Boost安装:fatal error: bzlib.h: No such file or directory 问题

    参考: How to install all the boost development libraries? 解决 Boost安装:fatal error: bzlib.h: No such fil ...

  8. WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错

          WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错   当我们在客户端添 ...

  9. 解决执行脚本报syntax error: unexpected end of file或syntax error near unexpected token `fi'错误的问题

    参考:https://blog.csdn.net/u012453843/article/details/69803244 解决执行脚本报syntax error: unexpected end of ...

随机推荐

  1. 在xshell中使用Linux语言打开错误提示

    上线项目到服务器后, 有时候有的功能跟本地调试的不一样,这时候就需要设置打开display_errors = On: 首先,cd .. 进入上一级,ll 罗列当前目录,跟home当前目录的有这个usr ...

  2. seafile文档

    https://manual-cn.seafile.com/deploy_windows/download_and_setup_seafile_windows_server.html

  3. SQL repeat()函数

    转自:https://www.yiibai.com/sql/sql-repeat-function.html REPEAT(str,count) 返回一个字符串组成的字符串STR重复的次数.如果计数小 ...

  4. Python 之Event

    线程间互相等状态. import threading import time import logging logging.basicConfig(level=logging.DEBUG, forma ...

  5. c/c++面试19-22----inline的那些事儿

    19 为什么引入内联函数 a:宏定义为什么效率高 通常替代c语言中表达式形式的宏定义来解决程序函数调用问题,使用的是预处理器实现,没有参数压栈等到做. 缺点: (1) 仅仅进行简单的替换,不能进行参数 ...

  6. JAVA基础--JAVA API集合框架(ArrayList、HashSet、HashMap使用)14

    一.集合Collection 1. 集合介绍 变量:表示的内存中的一个空间,只能保存确定类型的单个数据 数组:表示的是内存中的多个连续的空间,这些空间中可以存储多个同类型的数据. 后期继续学习面向对象 ...

  7. 使用Spring Security控制会话

    1.概述 在本文中,我们将说明Spring Security如何允许我们控制HTTP会话.此控件的范围从会话超时到启用并发会话和其他高级安全配置. 2.会话何时创建? 我们可以准确控制会话何时创建以及 ...

  8. E20190407-hm

    conclude  vt. 推断; 结束,终止; 议定; vi. 终了; 作出决定或达成协议; interjection  n. 叹词,感叹词; definitely  adv. 明确地; 确切地; ...

  9. react native 安卓打包--mac环境,如果打包不成功可注意下my-release-key.keystore的位置关系(绝对路径)

    // my-release-key.keystore和my-key-alias都是可修改的名称 1.生成签名密钥(keytool -genkey -v -keystore my-release-key ...

  10. 在接口的实现类里使用@Override注解报错

    问题分析 @Override注解用来检测子类对父类或接口的方法的重写是否正确,但有一次我在Eclipse里对接口的实现类里使用@Override注解却报错,不过在父类的子类里使用该注解却是正常的. 百 ...