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

半腔热情 提交于 2019-12-07 06:43:17

问题


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


回答1:


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.




回答2:


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




回答3:


I've had a similar problem on debian testing after an upgrade. Reinstalling eclipse / cdt did not help.

I've had to rm -r "$HOME/.eclipse" to get it working again.



来源:https://stackoverflow.com/questions/16953548/eclipse-missing-c-c-build-and-general-from-project-properties

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!