可以参考  http://www.linuxidc.com/Linux/2014-03/97628.htm

解决方案 »

  1.   

    根据上面的介绍,我做了下面的处理:
    1.frameworks/base/tools/aapt/Android.mk,增加 -fpermissive2. frameworks/base/libs/utils/Android.mk,增加 -fpermissive
    LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)  –fpermissive编译的错误信息变为如下:
    external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h:233:39: error: ‘GetState’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    external/srec/tools/thirdparty/OpenFst/fst/lib/fstlib.h:
    external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h:214:24: error: ‘Final’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    external/srec/tools/thirdparty/OpenFst/fst/lib/fstlib.h:
    external/srec/tools/thirdparty/OpenFst/fst/lib/vector-fst.h:325:37: error: ‘SetInputSymbols’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
    ..............
      

  2.   

    就没有遇到编译方面的问题吗?
    我以前也用14.04编译过2.3的源码,出的问题非常多,也是出现了几个地方要加fpermissive的,不过后来还是编成功了。我用12.04编译4.0的代码的时候,遇到的问题非常少啊,只要完全按照官网把那些该装的都装了,基本是不会遇到问题的。
      

  3.   

    就没有遇到编译方面的问题吗?
    我以前也用14.04编译过2.3的源码,出的问题非常多,也是出现了几个地方要加fpermissive的,不过后来还是编成功了。我用12.04编译4.0的代码的时候,遇到的问题非常少啊,只要完全按照官网把那些该装的都装了,基本是不会遇到问题的。
    有记录下来吗?麻烦分享下,先谢谢了。
      

  4.   

    就没有遇到编译方面的问题吗?
    我以前也用14.04编译过2.3的源码,出的问题非常多,也是出现了几个地方要加fpermissive的,不过后来还是编成功了。我用12.04编译4.0的代码的时候,遇到的问题非常少啊,只要完全按照官网把那些该装的都装了,基本是不会遇到问题的。
    有记录下来吗?麻烦分享下,先谢谢了。
    我是用虚拟机来装的ubuntu。
    ubuntu 12.04带的是gcc4.6,要换成4.4的,g++也一样。
    你要编4.0的源码,就要装JDK 1.6。
    然后其他步骤按照https://source.android.com/source/downloading.html这个来就好了。
    你把所有的都装好之后,记得执行下gcc --version和g++ --version,看是不是4.4的版本,有时候装一些包,会把gcc和g++卸载掉,我就遇到过,所以编译前确保所有的包都装好了。
      

  5.   

    折腾了很久,终于解决了,见我的分享:http://blog.csdn.net/loongembedded/article/details/38014841
    谢谢大家的帮忙