Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?)

like image 813
18446744073709551615 Avatar asked Jan 17 '23 15:01

18446744073709551615


2 Answers

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
like image 99
18446744073709551615 Avatar answered Jan 28 '23 07:01

18446744073709551615


Take a look at ARM Development Studio 5 (DS-5). The Community Edition is free for non-commercial use and offers integration with the NDK in Eclipse.

Further, I believe if you dig around a bit you'll find non-official instructions from various sources on how to integrate the NDK in Elipse. For example, look at some of this:

  • Using Eclipse for Android C/C++ Development
  • Using Eclipse for Android C/C++ Debugging
like image 27
NuSkooler Avatar answered Jan 28 '23 06:01

NuSkooler