VC编程之解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb
小标 2018-08-28 来源 : 阅读 1811 评论 0

摘要:本文主要向大家介绍了VC编程之解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb,通过具体的内容向大家展示,希望对大家学习VC编程有所帮助。

本文主要向大家介绍了VC编程之解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb,通过具体的内容向大家展示,希望对大家学习VC编程有所帮助。

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

一劳永逸的解决方案

直接修改cocos的项目模板templates\cpp-template-default\proj.win32\HelloCpp.vcxproj为:

<?xml version="1.0" encoding="utf-8"?>

<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="//schemas.microsoft.com/developer/msbuild/2003">

  <ItemGroup Label="ProjectConfigurations">

    <ProjectConfiguration Include="Debug|Win32">

      <Configuration>Debug</Configuration>

      <Platform>Win32</Platform>

    </ProjectConfiguration>

    <ProjectConfiguration Include="Release|Win32">

      <Configuration>Release</Configuration>

      <Platform>Win32</Platform>

    </ProjectConfiguration>

  </ItemGroup>

  <PropertyGroup Label="Globals">

    <ProjectGuid>{76A39BB2-9B84-4C65-98A5-654D86B86F2A}</ProjectGuid>

    <RootNamespace>test_win32</RootNamespace>

    <Keyword>Win32Proj</Keyword>

  </PropertyGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">

    <ConfigurationType>Application</ConfigurationType>

    <CharacterSet>Unicode</CharacterSet>

    <WholeProgramOptimization>true</WholeProgramOptimization>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>

    <PlatformToolset>v120</PlatformToolset>

  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">

    <ConfigurationType>Application</ConfigurationType>

    <CharacterSet>Unicode</CharacterSet>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '10.0'">v100</PlatformToolset>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0'">v110</PlatformToolset>

    <PlatformToolset Condition="'$(VisualStudioVersion)' == '11.0' and exists('$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A')">v110_xp</PlatformToolset>

    <PlatformToolset>v120</PlatformToolset>

  </PropertyGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

  <ImportGroup Label="ExtensionSettings">

  </ImportGroup>

  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">

    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

    <Import Project="..\cocos2d\cocos\2d\cocos2dx.props" />

    <Import Project="..\cocos2d\cocos\2d\cocos2d_headers.props" />

  </ImportGroup>

  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">

    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />

    <Import Project="..\cocos2d\cocos\2d\cocos2dx.props" />

    <Import Project="..\cocos2d\cocos\2d\cocos2d_headers.props" />

  </ImportGroup>

  <PropertyGroup Label="UserMacros" />

  <PropertyGroup>

    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>

    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>

    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration).win32\</IntDir>

    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>

    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration).win32\</OutDir>

    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration).win32\</IntDir>

    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>

    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>

    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />

    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />

    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>

    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />

    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />

  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

    <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>

  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

    <LibraryPath>$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\lib;$(LibraryPath)</LibraryPath>

  </PropertyGroup>

  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

    <ClCompile>

      <Optimization>Disabled</Optimization>

      <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

      <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>

      <MinimalRebuild>false</MinimalRebuild>

      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>

      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>

      <PrecompiledHeader>

      </PrecompiledHeader>

      <WarningLevel>Level3</WarningLevel>

      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>

      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>

      <MultiProcessorCompilation>true</MultiProcessorCompilation>

      <AdditionalOptions>/FS %(AdditionalOptions)</AdditionalOptions>

    </ClCompile>

    <Link>

      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>

      <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>

      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

      <GenerateDebugInformation>true</GenerateDebugInformation>

      <SubSystem>Windows</SubSystem>

      <TargetMachine>MachineX86</TargetMachine>

    </Link>

    <PostBuildEvent>

      <Command>

      </Command>

    </PostBuildEvent>

    <PreLinkEvent>

      <Command>if not exist "$(OutDir)" mkdir "$(OutDir)"

xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"</Command>

    </PreLinkEvent>

  </ItemDefinitionGroup>

  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

    <ClCompile>

      <Optimization>MaxSpeed</Optimization>

      <IntrinsicFunctions>true</IntrinsicFunctions>

      <AdditionalIncludeDirectories>$(EngineRoot)cocos\audio\include;$(EngineRoot)external;$(EngineRoot)external\chipmunk\include\chipmunk;$(EngineRoot)extensions;..\Classes;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

      <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>

      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>

      <FunctionLevelLinking>true</FunctionLevelLinking>

      <PrecompiledHeader>

      </PrecompiledHeader>

      <WarningLevel>Level3</WarningLevel>

      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>

      <DisableSpecificWarnings>4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>

      <MultiProcessorCompilation>true</MultiProcessorCompilation>

    </ClCompile>

    <Link>

      <AdditionalDependencies>libcurl_imp.lib;websockets.lib;%(AdditionalDependencies)</AdditionalDependencies>

      <OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>

      <AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

      <GenerateDebugInformation>true</GenerateDebugInformation>

      <SubSystem>Windows</SubSystem>

      <OptimizeReferences>true</OptimizeReferences>

      <EnableCOMDATFolding>true</EnableCOMDATFolding>

      <TargetMachine>MachineX86</TargetMachine>

    </Link>

    <PostBuildEvent>

      <Command>

      </Command>

    </PostBuildEvent>

    <PreLinkEvent>

      <Command>if not exist "$(OutDir)" mkdir "$(OutDir)"

xcopy /Y /Q "$(EngineRoot)external\websockets\prebuilt\win32\*.*" "$(OutDir)"</Command>

    </PreLinkEvent>

  </ItemDefinitionGroup>

  <ItemGroup>

    <ClCompile Include="..\Classes\AppDelegate.cpp" />

    <ClCompile Include="..\Classes\HelloWorldScene.cpp" />

    <ClCompile Include="main.cpp" />

  </ItemGroup>

  <ItemGroup>

    <ClInclude Include="..\Classes\AppDelegate.h" />

    <ClInclude Include="..\Classes\HelloWorldScene.h" />

    <ClInclude Include="main.h" />

  </ItemGroup>

  <ItemGroup>

    <ProjectReference Include="..\cocos2d\cocos\2d\cocos2d.vcxproj">

      <Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project>

      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>

    </ProjectReference>

    <ProjectReference Include="..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj">

      <Project>{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project>

    </ProjectReference>

    <ProjectReference Include="..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj">

      <Project>{207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project>

    </ProjectReference>

  </ItemGroup>

  <ItemGroup>

    <ResourceCompile Include="game.rc" />

  </ItemGroup>

  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

  <ImportGroup Label="ExtensionTargets">

  </ImportGroup>

</Project>

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

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标编程语言VC/MFC频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程