but there is no the file now.
even I copy form the former version and run, it will reports error:
Installing Xcode 4 cocos2d-x iOS template—————————————————-…creating destination directory: /Users/mymac/Library/Developer/Xcode/Templates/cocos2d-x/…copying cocos2d files…copying CocosDenshion files…copying websockets files…copying extension files…copying template filesrsync: link_stat “/Users/mymac/cocos2d-x-3.0alpha0-pre/template/xcode4/.” failed: No such file or directory (2)rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(992) [sender=2.6.9]done!
Download the code from Github or from cocos2d download site
Run the create-multi-platform-projects.py script
Example:
$ cd cocos2d-x
$ ./create-multi-platform-projects.py p mygamek com.your_company.mygame ~~l cpp
$ cd projects/mygame
it reported
>~~bash: ./create-multi-platform-projects.py: /usr/bin/evn: bad interpreter: No such file or directory
import os
from tools.project_creator import create_project
if name == ‘main’:
os.chdir(os.getcwd()+‘/tools/project_creator/’)
create_project.createPlatformProjects()
if I enter directory of /tools/project_creator
and call
./create_project.py ~~p <PROJECT_NAME>~~k <PACKAGE_NAME> ~~l <cpp|lua|javascript>
it reports error:
>~~bash: syntax error near unexpected token `newline’
my python is
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
mountain lion 10.8.3
You should call some kind of this in /tools/project_creator:
>
./create_project.py p MyNewProjectNamel cpp -k com.MyCompany.Awesome
>
It will create the cocos2dx cpp project for you.
I’m running into the same issue and I’m confused. What’s broke here? Does one of the python scripts need to be corrected? How come this doesn’t work as the tutorial says it should? I’d like to use the multi-platform setup but it sounds like it isn’t working correctly yet. Everything worked fine on the Windows side but I’m having a really tough time getting this to work for my Mac. Even if I use the files created from my Windows machine it appears that they won’t build correctly from XCode. Maybe the paths are incorrect from running on my other machine? Finally, at no point does any of this appear to put the proper templates into XCode. Currently I’m unable to build iOS projects created with the Python script (either locally or from another machine) nor can I create a project from scratch as the templates are missing. I realize that this is in “alpha”, but seems like this should be pretty basic functionality!
Ideally I’d like for these projects to get stored on my NAS and then each builder can be accessed from the relevant OS.
Just for clarification, I’m just trying to build and deploy the Cocos2d-x default “HelloWorld” program. I’ve run the Python script from both another machine (1st attempt below) and natively on my dev Mac (2nd attempt). Cocos2d-x templates currently don’t show up as an option for new XCode projects, not sure how to install these anymore. The output files of the scripts appears to work fine both ways, but the resulting iOS project folder and project will not compile for me.
This is the error from the code I tried to compile from my NAS:
CompileC /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/Objects-normal/i386/HelloWorldScene.o …/classes/…/Classes/HelloWorldScene.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios
setenv LANG en_US.US-ASCII
setenv PATH “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ~~x c*+ arch i386fmessage-length=0 ~~std=c11 ~~stdlib=libc*+ Wno-trigraphsfpascal-strings O0Wno-missing-field-initializers Wno-missing-prototypesWreturn-type Wno-non-virtual-dtorWno-overloaded-virtual Wno-exit-time-destructorsWformat Wno-missing-bracesWparentheses WswitchWno-unused-function Wno-unused-labelWno-unused-parameter Wunused-variableWunused-value Wno-empty-bodyWno-uninitialized Wno-unknown-pragmasWno-shadow Wno-four-char-constantsWno-conversion Wno-constant-conversionWno-int-conversion Wno-enum-conversionWno-shorten-64-to-32 Wno-newline-eofWno-c11-extensions DUSE_FILE32APIDCC_TARGET_OS_IPHONE DCOCOS2D_DEBUG=1DCC_ENABLE_CHIPMUNK_INTEGRATION=1 isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdkfexceptions fasm-blocksfstrict-aliasing Wdeprecated-declarationsWinvalid-offsetof gWno-sign-conversion mios-simulator-version-min=5.0iquote /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/MyFirstCPGame-generated-files.hmap I/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/MyFirstCPGame-own-target-headers.hmapI/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/MyFirstCPGame-all-target-headers.hmap iquote /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/MyFirstCPGame-project-headers.hmapI/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Products/Debug-iphonesimulator/include I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/CocosDenshion/includeI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/external/chipmunk/include/constraints I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/external/chipmunk/include/chipmunkI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/extensions I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dx/kazmath/includeI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/external I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dxI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dx/include I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dx/platform/third_party/iosI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dx/platform/ios I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/…/…/cocos2dx/platform/ios/SimulationI/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/DerivedSources/i386 I/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/DerivedSourcesF/Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Products/Debug-iphonesimulator O2include /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/PrecompiledHeaders/Prefix-fhmwvpwqpyhussaxbdpjnomtjjgr/Prefix.pch MMDMT dependencies MF /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/Objects-normal/i386/HelloWorldScene.d —serialize-diagnostics /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/Objects-normal/i386/HelloWorldScene.diac /Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/classes/…/Classes/HelloWorldScene.cpp o /Users/andy/Library/Developer/Xcode/DerivedData/MyFirstCPGame-aunkekwyvbxtifftprhrakcdlryy/Build/Intermediates/MyFirstCPGame.build/Debug-iphonesimulator/MyFirstCPGame.build/Objects-normal/i386/HelloWorldScene.o
clang: error: no such file or directory: ‘/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/MyFirstCPGame/proj.ios/…/classes/…/Classes/HelloWorldScene.cpp’
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
h2. And this is what I got from trying the same thing completely native on the Mac:
CompileC /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/Objects-normal/i386/AppDelegate.o …/classes/…/Classes/AppDelegate.cpp normal i386 c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios
setenv LANG en_US.US-ASCII
setenv PATH “/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin”
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clangx c*+arch i386 fmessage-length=0std=c**11stdlib=libc*+~~Wno-trigraphs fpascal-stringsO0 Wno-missing-field-initializersWno-missing-prototypes Wreturn-typeWno-non-virtual-dtor Wno-overloaded-virtualWno-exit-time-destructors WformatWno-missing-braces WparenthesesWswitch Wno-unused-functionWno-unused-label Wno-unused-parameterWunused-variable Wunused-valueWno-empty-body Wno-uninitializedWno-unknown-pragmas Wno-shadowWno-four-char-constants Wno-conversionWno-constant-conversion Wno-int-conversionWno-enum-conversion Wno-shorten-64-to-32Wno-newline-eof Wno-c++11-extensionsDUSE_FILE32API DCC_TARGET_OS_IPHONEDCOCOS2D_DEBUG=1 DCC_ENABLE_CHIPMUNK_INTEGRATION=1isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk fexceptionsfasm-blocks fstrict-aliasingWdeprecated-declarations Winvalid-offsetofg Wno-sign-conversionmios-simulator-version-min=5.0 iquote /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/FirstProjectTest-generated-files.hmapI/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/FirstProjectTest-own-target-headers.hmap I/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/FirstProjectTest-all-target-headers.hmapiquote /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/FirstProjectTest-project-headers.hmap I/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Products/Debug-iphonesimulator/includeI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/CocosDenshion/include I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/external/chipmunk/include/constraintsI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/external/chipmunk/include/chipmunk I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/extensionsI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx/kazmath/include I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/externalI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx/includeI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx/platform/third_party/ios I/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx/platform/iosI/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/…/…/cocos2dx/platform/ios/Simulation I/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/DerivedSources/i386I/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/DerivedSources F/Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Products/Debug-iphonesimulatorO2 include /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/PrecompiledHeaders/Prefix-amjrergilibmqbeymqlwarhwecsa/Prefix.pchMMD MT dependenciesMF /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/Objects-normal/i386/AppDelegate.d —serialize-diagnostics /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/Objects-normal/i386/AppDelegate.dia c /Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/classes/…/Classes/AppDelegate.cppo /Users/andy/Library/Developer/Xcode/DerivedData/FirstProjectTest-brsfisildozlijasgqnesyddcnik/Build/Intermediates/FirstProjectTest.build/Debug-iphonesimulator/FirstProjectTest.build/Objects-normal/i386/AppDelegate.o
clang: error: no such file or directory: ‘/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0-pre/projects/FirstProjectTest/proj.ios/…/classes/…/Classes/AppDelegate.cpp’
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
They exist in the folders that the Python script created. I’m not sure why XCode isn’t finding them. I suspected it did something strange with it’s own paths, which is why I tried unzipping and installing the cocos2dx on the local machine (my second attempt). Anyways, I hope to have XCode 5 installed by tomorrow and I’ll try installing again with the new alpha release. Hopefully things will go better…
It looks like it’s the iOS path the builder is using is different from the path the installer actually placed it. For example:
clang: error: no such file or directory: '/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0/cocos2d-x-3.0alpha0/projects/Take3Test/proj.ios_mac/../classes/../Classes/AppDelegate.cpp' clang: error: no input files Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
The actual directory with that file is located at:
/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0/cocos2d-x3.0alpha0/projects/Take3Test/Classes/AppDelegate.cpp
I don’t know enough about the iOS build process to track down why there is an extra “…/classes” in there, but I’ll be trying. This is using the new alpha just released and Xcode 4.6.3. 5 is still downloading, but hopefully I’ll be able to try that tomorrow.
/Volumes/projects/Cocos2d-x/cocos2d-x-3.0alpha0/cocos2d-x-3.0alpha0/projects/Take3Test/proj.ios_mac/ios/AppController.mm:4:9: fatal error: ‘AppDelegate.h’ file not found #import “AppDelegate.h”
^
1 error generated.
I think I’m give this one more day of trying to fix then I might have to move my project to Unity. I can handle reworking the code to the new API and names (spent a couple of hours trying to get rid of all the warnings generated in VS2012 by “deprecated” code), but the fact that the fairly simple default code won’t build in XCode at all out of the box is a bit too much for me. Thanks to all that tried to help!