Is there a way to be able to code the C++ parts using Eclipse and its context assist? Because the source code is separate from the android folder, I’d have to make a new project. Even if I did that, the headers wouldn’t all resolve because the lib and stuff are compiled in the android folder. In my opinion, it would be easier if you AndroidManifest.xml in the project’s root folder and just create a makefile with android, win32, and ios targets.
Also is there a way to make a Win32 project using Eclipse? I don’t have VisualStudio and don’t want to bother learning it.
ha, I always write codes in Xcode or VisualStudio, then run ndk build in command line, pack in eclipse.
Waiting eclipse masters to answer this question.
I Manually Integrated the Test suite with Eclipse.
Now I can Modify the C/C*+ and Java code from the Eclipse and with single click on Clean/Auto Build, The android apk file is generated by Eclipse.
*I have Eclipse with JEE Installed already.+
To Edit java/C/C+ code at the same Time*
First Installed CDT plugin from Eclipse Update site using Eclipse —> Help —> Install New Software.
# Create the Project using the Cocos2d-x android project template.
# Go to Eclipse —> New Android Project and select create project with existing source.
# Go to Eclipse —> File —> NEW —> Convert to a C/C+ project.
The project properties has now Java as well as C/C*+ Build options.
# Go to Project —> Properties —>C/C*+ General —>Paths and Symbols.
# Now Add all the Header file Include Directories required by your project under Include Tab.
# Add your project C/C++ Source files/Folder under the “Source Location” Tab and Press Apply and OK. With this Now I am able to Code java and C/C++ at the same time.
h1.**Building the project i.e Generating Project.apk in Eclipse*
Go to Project —> Properties —> Click on Builders —> Click On New
Select Program and click ok.
Enter any Name or some thing like “NDK Build Configuration” in the Name Tab.
Click on Main tab, Enter the path of your Cygwin bash.exe in the Location box. Ex: C:.exe
Enter the Cygwin Bin folder path in the Working Directory box. Ex: C:# In the Arguments box Enter the command in the below format loginc “cd /cygdrive/PATH to YOUR Project Directory && ./build_native.sh”
Example: —login -c “cd /cygdrive/d/Android/cocos2d/tests/test.android && ./build_native.sh”
Click on Refresh tab
Select “Specific resources” radio button and click on Specify Resources button and select only the lib’s folder check box under your Android project and click finish.
Select the “Recursively include sub-folders check box.
# Click on Build Options Tab and Select”Specify working set of relevant resources" check box and click on the Specify Resources button and select the Jni folder check box under your android project and click finish.
Now select all the check boxes except “File” and “During a Clean”
Do I include cocos2d-x/cocos2dx/include or just the cocos2d-x/cocos2dx folder? cause main.cpp can’t find cocos2d.h. Also, what kind of C/C++ project do I convert it to? Executable, Shared Library, or something else?
Found out another way to do it. It’s similar to yours, RamaKrishna, but I didn’t use a builder. What I did convert it to a C++ project as a makefile project, specifying my own toolset. I made a makefile in the project’s root folder with the following entry:
all:
./build_native.sh
I had to change build_native.sh’s build variables to use windows path names rather than cygwin path names as seen below:
/cygdrive/c/cygwin/bin -> C:/cygwin/bin
For content assist, and so that eclipse wouldn’t whine about unresolved files, I just linked the header folders as source locations, rather than as includes. Here are the folders that I linked:
for C/C++ assists: C:\android-ndk-r5b\sources\
for created classes: C:\cocos2d-x\myProject\Classes\
for cocos2d assists: C:\cocos2d-x\cocos2d\
I’m still having issues with the instructions :(, I wish there is a full tutorial on this one, cause it is really important and I need to edit c++ and build the project using eclipse.
any help would be greatly appreciated
Happy to see that it works Breaking Floor Can you, or anybody, write a very detailed step by step procedure/tutorial on this topic ? Would be really great
MG_14@MG_14-PC /cygdrive/c/Development/cocos2d-x12/ecli/android
$ /cygdrive/c/Development/android-ndk-r7b/ndk-gdb-eclipse
awk: fatal: can't open source file `/cygdrive/c/Development/cocos2d-x12/ecli/android/C:\Development\android-ndk-r7b/build/awk/check-awk.awk' for reading (No such file or directory)
ERROR: Could not run '/usr/bin/awk' command. Do you have it installed properly?
I visited my C:-ndk-r7b/build/awk/check-awk.awk. The file exists there. which path do I need to edit ?
hello,
when i followed the steps of
“To Edit java/C/C*+ code at the same Time and Building the project i.e Generating Project.apk in Eclipse”
that i can compiled the c*+ code. thanks.
But i don’t know how to compiled to apk(because i changed to c++ project according to the steps,and also prompt me have no make target
make: * No rule to make target `all’. Stop.
)