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为:
原文链接:https://www.f2er.com/cocos2dx/340546.html
- <?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>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <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>
- <PrecompiledHeader>
- </PrecompiledHeader>
- </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\cocos\2d\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>