score:1

im not sure if this will be an answer for you. my experiences are different, i'm on windows, and i was only trying to get c (not c++) code working. but ran into exactly the same issue. and my solution could seemly be used to work for c++ as well. as far as i can tell, eclipse/adt on mac is much the same as on windows. so that shouldn't be a problem here. who knows, i could be talking out of my a--.

however, i think the problem is solved two fold. here is how i solved it. i followed the tutorial: http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/

things to note:

1) when developing in eclipse/adt for android. it always assumes that your writing in java. you need to make the project "mixed java & c/c++" (not that i've seen it called this outside the tutorial, lol)

2) your ndk-build should probably work fine from the command line (even tho it might not compile in eclipse).

3) in the tutorial, the two things that seemed to get it to recognize c/c++ are "step 5: convert to a c/c++ project" followed by steps 6-8 (which seem like one big step).

4) in step 7, under "build command". you might have to use a the complete path (no spaces) to your ndk-build. (*windows users enter "ndk-build.cmd" here)

5) in step 8, also include a full path.. no spaces. however, this is where you would put a path in for "gnc c++" instead. (this is my guess for your solution)

6) if all else fails... it should work in c. try step 8 exactly, and use only c syntax. because, at the top of this older tutorial (http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/) it talks about how limited ndk is. it says c++ functionality is limited. otherwise, this second tutorial is mostly obsolete it seems. cygwin and command line compilation are not needed anymore, and my eclipse installation had the c/c++ support out-of-box. however, its all still usable/valid.

pt

(and on a similar note, and for those seeking help with ndk. also make sure a space-less full path to your ndk folder is entered in at eclipse > window > preferences > android > ndk > ndk location)


Related Query

More Query from same tag