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为:
<?xmlversion="1.0"enCoding"utf-8"?> <ProjectDefaultTargets="Build"Toolsversion"12.0"xmlns"http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroupLabel"ProjectConfigurations"> <ProjectConfigurationInclude"DeBUG|Win32"> <Configuration>DeBUG</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> "Release|Win32"> Release</Configuration> </Platform> </ProjectConfiguration> </ItemGroup> <PropertyGroup"Globals"<ProjectGuID>{76A39BB2-9B84-4C65-98A5-654D86B86F2A}</ProjectGuID> <Rootnamespace>test_win32</Rootnamespace> <Keyword>Win32Proj</Keyword> </PropertyGroup> <importProject"$(VCTargetsPath)\Microsoft.Cpp.Default.props"/> Condition"'$(Configuration)|$(Platform)'=='Release|Win32'""Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> <PlatformToolset"'$(VisualStudioVersion)'=='10.0'">v100</PlatformToolset> "'$(VisualStudioVersion)'=='11.0'"v110</PlatformToolset> "'$(VisualStudioVersion)'=='11.0'andexists('$(MSBuildProgramfiles32)\MicrosoftSDKs\windows\v7.1A')"v110_xp</PlatformToolset> <PlatformToolset>v120</PlatformToolset> "'$(Configuration)|$(Platform)'=='DeBUG|Win32'"</ConfigurationType> </CharacterSet> </PlatformToolset> </PlatformToolset> </PropertyGroup> "$(VCTargetsPath)\Microsoft.Cpp.props"/> <importGroup"ExtensionSettings"> </importGroup> "propertysheets""$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props""exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')""LocalAppDataPlatform"/> "..\cocos2d\cocos\2d\cocos2dx.props"/> "..\cocos2d\cocos\2d\cocos2d_headers.props"/> </importGroup> /> /> "UserMacros"/> <PropertyGroup> <_ProjectFiLeversion>10.0.40219.1</_ProjectFiLeversion> <OutDir"'$(Configuration)|$(Platform)'=='DeBUG|Win32'"$(SolutionDir)$(Configuration).win32\</OutDir> <IntDir$(Configuration).win32\</IntDir> <linkIncremental</linkIncremental> "'$(Configuration)|$(Platform)'=='Release|Win32'"</OutDir> </IntDir> false</linkIncremental> <CodeAnalysisRuleSetAllRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRules<CodeAnalysisRuleAssemblIEs</CodeAnalysisRuleSet> /> </PropertyGroup> > <libraryPath>$(MSBuildProgramfiles32)\MicrosoftSDKs\windows\v7.1A\lib;$(libraryPath)</libraryPath> </libraryPath> </PropertyGroup> <ItemDeFinitionGroup> <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></MinimalRebuild> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <Runtimelibrary>MultiThreadedDeBUGDLL</Runtimelibrary> <@R_424_3013@header> </@R_424_3013@header> <WarningLevel>Level3</WarningLevel> <DeBUGinformationFormat>EditAndContinue</DeBUGinformationFormat> <disableSpecificWarnings>4267;4251;4244;%(disableSpecificWarnings)</disableSpecificWarnings> <MultiProcessorCompilation></MultiProcessorCompilation> <AdditionalOptions>/FS%(AdditionalOptions)</AdditionalOptions> </ClCompile> <link> <AdditionalDependencIEs>%(AdditionalDependencIEs)</AdditionalDependencIEs> <Outputfile>$(OutDir)$(Projectname).exe</Outputfile> <AdditionallibraryDirectorIEs>$(OutDir);%(AdditionallibraryDirectorIEs)</AdditionallibraryDirectorIEs> <GenerateDeBUGinformation></GenerateDeBUGinformation> <SubSystem>windows</SubSystem> <TargetMachine>MachineX86</TargetMachine> </link> <PostBuildEvent> <Command> </Command> </PostBuildEvent> <PrelinkEvent> <Command>ifnotexist"$(OutDir)"mkdir"$(OutDir)" xcopy/Y/Q"$(EngineRoot)external\websockets\prebuilt\win32\*.*""$(OutDir)"</Command> </PrelinkEvent> </ItemDeFinitionGroup> <ClCompile> MaxSpeed</Optimization> <IntrinsicFunctions></IntrinsicFunctions> </AdditionalincludeDirectorIEs> WIN32;NDEBUG;_windows;_USE_MATH_defineS;GL_GLEXT_PROTOTYPES;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDeFinitions)</PreprocessorDeFinitions> MultiThreadedDLL</Runtimelibrary> <FunctionLevellinking></FunctionLevellinking> <@R_424_3013@header> </@R_424_3013@header> </WarningLevel> ProgramDatabase</DeBUGinformationFormat> </disableSpecificWarnings> </MultiProcessorCompilation> </ClCompile> <link> libcurl_imp.lib;websockets.lib;%(AdditionalDependencIEs)</AdditionalDependencIEs> </Outputfile> </AdditionallibraryDirectorIEs> </GenerateDeBUGinformation> </SubSystem> <OptimizeReferences></OptimizeReferences> <EnableCOMDATFolding></EnableCOMDATFolding> </TargetMachine> </link> <PostBuildEvent> <Command> </PostBuildEvent> <PrelinkEvent> ifnotexist"$(OutDir)"mkdir"$(OutDir)" </Command> </PrelinkEvent> </ItemDeFinitionGroup> <ItemGroup> <ClCompile"..\Classes\AppDelegate.cpp""..\Classes\HelloWorldScene.cpp""main.cpp"<ItemGroup> <Clinclude"..\Classes\AppDelegate.h"/> "..\Classes\HelloWorldScene.h""main.h"</ItemGroup> <ProjectReference"..\cocos2d\cocosd\cocos2d.vcxproj"<Project>{98a51ba8-fc3a-415b-ac8f-8c7bd464e93e}</Project> <ReferenceOutputAssembly></ReferenceOutputAssembly> </ProjectReference> "..\cocos2d\cocos\audio\proj.win32\CocosDenshion.vcxproj"{f8edd7fa-9a51-4e80-baeb-860825d2eac6}</Project> </ProjectReference> "..\cocos2d\external\chipmunk\proj.win32\chipmunk.vcxproj"> {207bc7a9-ccf1-4f2f-a04d-45f72242ae25}</Project> </ProjectReference> </ItemGroup> <ItemGroup> <ResourceCompile"game.rc""$(VCTargetsPath)\Microsoft.Cpp.targets""ExtensionTargets"</importGroup> </Project>
这样不仅解决了这个问题,还能避免每次开新项目时的强制升级。
总结以上是内存溢出为你收集整理的解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb全部内容,希望文章能够帮你解决解决 Cocos2d-x 3.2 error C1041: 无法打开程序数据库vc120.pdb所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)