How to setup Cocos2d-X on Windows-7
1. Download
all these files and save it either C:\ or D:\ drive on your system.
a) Download
the Cocos2d-X http://www.cocos2d-x.org/filedown/cocos2d-x-3.2.zip
c) Download
the updated NDK for 32-bit or 64-bit http://dl.google.com/android/ndk/android-ndk32-r10-windows-x86.zip
e) Download
the updated Python https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi
2. Extract
all the zip files in the same drive.
3. Now
install the “python-2.7.8.msi”
4. Now
open the command prompt and run these commands:
a)
C:\Users\d>cd
C:\Developer\cocos2d-x-3.2_4
b)
C:\Developer\cocos2d-x-3.2_4\setup.py
(It
create the setup for the cocos2d-x and asked to setup for the NDK_ROOT,
SDK_ROOT, ANT_ROOT)
c)
C:\Developer\android-ndk-r10
d)
C:\Developer\adt-bundle-windows-x86-20140702\sdk
e)
C:\Developer\apache-ant-1.9.4\bin
5. Now
restart the computer or command prompt
6. Open
the command prompt and again run C:\Developer\cocos2d-x-3.2_4\setup.py
to check all the Path has been set
7. Now
create the project with command
cocos.py new PROJECT_NAME –p PACKAGE_NAME –l Language (example:
cocos.py new MyApp –p com.example.MyApp –l cpp)
8. Now
open the project from where is it saved (my case:
it is saved in C:\Developer\cocos2d-x-3.2_4\cocos2d-x-3.2\MyApp) and drag-n-drop
it to the command prompt
9. Now
open the proj.android from created project C:\Developer\cocos2d-x-3.2_4\cocos2d-x-3.2\MyApp\proj.android
10. Now
run the project with the command build_native.py
(This
will compile the cocos2d-x and our project)
11. Now
open the eclipse.exe
12. Import
the project from Android Existing Projects proj.android
and libcocos2dx (my case: it
is saved in C:\Developer\cocos2d-x-3.2_4\cocos2d-x-3.2\MyApp)
13. Now
RUN the project
You may get the Error:
make.exe: [obj/local/armeabi/objs-debug/cocos2dx_static/3d/CCBundleReader.o]
Error 1
make.exe: Waiting for unfinished jobs....
make.exe: Leaving directory `D:/cocos2d-x-3.2/tests/cpp-tests/proj.android'
Build dynamic library for project [ D:\cocos2d-x-3.2\build..\tests/cpp-tests/proj.android ] fails!
make.exe: Waiting for unfinished jobs....
make.exe: Leaving directory `D:/cocos2d-x-3.2/tests/cpp-tests/proj.android'
Build dynamic library for project [ D:\cocos2d-x-3.2\build..\tests/cpp-tests/proj.android ] fails!
Solution:
The cause is that it's declared as "long int"
in the header and "ssize_t" in the definition. I'm sure it will be
patched soon officially, but locally you can just change "ssize_t
BundleReader::tell()" to "long int BundleReader::tell()" and it
should compile and link fine.
No comments:
Post a Comment