Skip to content
Advertisement

Need a simple Linux C++ IDE (Android NDK) [closed]

I need an IDE that must:

  1. allow running the ~/android-ndk-r7/ndk-build script for compilation;
  2. intercept the gcc output and show it to me;
  3. when I click on an error line, go to error location: open the mentioned file at the mentioned line.

I have a large existing C++ project and am porting it to Android/NDK.

(Neither Code::Blocks nor Eclipse do the 3rd. Maybe I am missing something?)

Advertisement

Answer

I configured Code::Blocks for Android NDK/JNI development, but there’s a trick. Codeblocks believes that it can know what compiler you use, and wants to stop you from using something it does not know. You have to trick it.

  1. Create an empty codeblocks project
  2. Add your source and header files (manually)
  3. Click the right mouse button on your project in the workspace (the left pane). You will see a menu: the two useful menu items
    (EDIT: First go to Properties and specify it’s a custom Makefile, then to Build options)
  4. Go to “Properties” and tell CB it has a custom Makefile. Do not tell it anything close to the truth about the platform: it will tell you that you don’t have the required compiler and will not even attempt to build something. custom makefile
  5. Finally, in the Build options, select the GNU GCC Compiler, go to the “Make commands”, and write your custom commands. (Personally I created a Makefile that invokes ndk-build — I prefer to keep scripts in the text files rather than in GUI dialogs. The item that you might want to change is -j 4)build options

And one final note: if your configuration does not work, you get no meaningful diagnostics.

PS Here’s my Makefile:

all:
    @echo '====all===='
    pwd;~/android-ndk-r7/ndk-build -j 4
clean:
    @echo '====clean===='
    pwd;~/android-ndk-r7/ndk-build clean

.PHONY: clean
.PHONY: all
Advertisement