用eclipse写ndk程序

在eclipse上写ndk程序,常常会出现莫名其妙的不能识别错误,程序不能编译经过,即使把ndk带有的头文件加进来也不行。可是在命令行下,这是能够编译经过的。android


查了老外的博客eclipse

How to remove android NDK support from eclipse projectide

Today I've got stuck with pretty much weird errors in eclipse while trying to use ccache and android ndk-build. post


Apart from the fact that compiling was not successful, eclipse showed me dozens of errors which were complete nonsense. However, when I tried to compile project in cygwin console by calling ndk-build, everything well smoothly (well, not at the first time - see my next posts if you are having "Permission denied" error for accessing to some prebuilt libraries, or if you are having problems with undefined classes which are defined in std:: namespace).  ui


But, if I tried to run program in eclipse - project run failed because of NDK errors. So, I've found a simple solution:spa


a) All NDK code build using command line and ndk-build all.命令行

b) Close eclipse, open project root, and delete .cproject file - you will remove C++ support from the projectcode

c) Use eclipse for everything else.ip

============
rem

总得来讲就是ndk的代码不用ide,直接在命令行下编译

-------只是删了.cproject是不行的,还要修改.project文件,把org.eclipse.cdt的属性都删掉-----by jackson ke

相关文章
相关标签/搜索