cocos2d-x 用VS2010 编译示例失败 MSB3073: exited with code 4

问题:

点击cocos2d-win32.vc2010.sln将cocos2d-x导入VS2010中生成解决方案,然后经过漫长的编译之后,编译器会告诉你有两个项目编译失败了。这两个失败的项目是WatermelonWithMe和CocosDragonJS。


具体错误信息:

Error 84 error MSB3073: The command "

if not exist "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\" mkdir "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\"

if exist "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\WatermelonWithMeRes" rd /s /q "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\WatermelonWithMeRes"

mkdir "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\WatermelonWithMeRes"

xcopy "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\samples\Javascript\WatermelonWithMe\proj.win32\..\..\..\..\scripting\javascript\bindings\js\*.js" "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\WatermelonWithMeRes" /e /Y

xcopy "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\samples\Javascript\WatermelonWithMe\proj.win32\..\..\Shared\games\WatermelonWithMe" "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\WatermelonWithMeRes\" /e /Y

:VCEnd" exited with code 4. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 103 6 WatermelonWithMe


Error 89 error MSB3073: The command "

if not exist "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\" mkdir "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\"

if exist "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\CocosDragonJSRes" rd /s /q "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\CocosDragonJSRes"

mkdir "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\CocosDragonJSRes"

xcopy "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\samples\Javascript\CocosDragonJS\proj.win32\..\..\..\..\scripting\javascript\bindings\js\*.js" "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\CocosDragonJSRes" /e /Y

xcopy "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\samples\Javascript\CocosDragonJS\proj.win32\..\..\Shared\games\CocosDragonJS\Published files Android" "C:\cocos2d-x-2.1.4\cocos2d-x-2.1.4\Debug.win32\\CocosDragonJSRes\" /e /Y

:VCEnd" exited with code 4. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 103 6 CocosDragonJS


原因:

Shared\games中没有WatermelonWithMe和CocosDragonJS两个目录


解决方法:

  • 把cocos2d-x-2.1.4\samples\Javascript\下的WatermelonWithMe和CocosDragonJS两个文件夹,拷贝到Shared\games\下

  • 在cocos2d-x-2.1.4\samples\Javascript\Shared\games\CocosDragonJS下新建文件夹Published files Android

  • 把cocos2d-x-2.1.4\samples\Javascript\Shared\games\CocosDragonJS下的文件夹Classes,proj.android,proj.ios,proj.win32复制到cocos2d-x-2.1.4\samples\Javascript\Shared\games\CocosDragonJS\Published files Android\中

你可能感兴趣的:(cocos2d-x 用VS2010 编译示例失败 MSB3073: exited with code 4)