Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse missing C/C++ build and general from project properties

I have eclipse running and am trying to get opencv4android on it (http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html)

Instructions say to go to project -> properties and their will be a C/C++ build to change the location of ndk-build. However, I do not see C/C++ build or general.

When I start eclipse and go to about:

Android Developer Tools

Build: v22.0.1-685705

This product includes Eclipse Platform, JDT, CDT, EMF, GEF and WTP, all of which are Copyright (c) Eclipse contributors and others. Visit http://eclipse.org/

Android Developer Tools are Copyright (c) The Android Open Source Project. Visit http://developer.android.com

like image 496
Jonovono Avatar asked Jun 06 '13 04:06

Jonovono


2 Answers

I had a similar problem, it looks like the "native support" part was not set up correctly in the project, or at least was not compatible with the eclipse / CDT / android sdk combination I have.

You can maybe try what I did (with eclipse 4.2.2, CDT 8.1.2, opencv4android 2.6.4, android sdk 4.3):

1) close all projects but the Opencv Library one (project explorer, select all projects but the first one, right click, "close project")

2) right click on the first project. Select "Android Tools", then "Add native support ...".

3) select a unique library name without spaces (default names don't work).

4) Go to project properties, the "c/c++ build" section should now be there. Change the build command to ${NDKROOT}/ndk-build, assuming NDKROOT was correctly set up before-hand.

5) right click again on that project. Select "Properties > Android", make sure an Android version is selected in the "Project Build Target" list.

6) build everything and make sure everything works at this point.

Then you can re-open one sample project (eg 15 puzzle), and repeat the operations above if needed.

Hopefully you should be able to build that sample project and launch it on your phone.

like image 109
dcoz Avatar answered Nov 15 '22 04:11

dcoz


It looks like NDK setting become a global setting not a project setting (plug in improvement) and instruction from opencv.org is outdated.

To setup it select: Window/Preferences then Android/NDK and choose "NDK location".

From now following instruction from opencv.org should make it work (If not try steps 1-3 from @dcoz answer, I did it but I'm not sure it if is necessary).

like image 43
Marek R Avatar answered Nov 15 '22 03:11

Marek R