您现在的位置:首页 > 博客 > Android开发 > 正文
Ubuntu 10.04 编译 android 1.5 源码出错问题解决
http://www.drovik.com/      2012-9-9 22:46:39      来源:Steersman原创      点击:

环境:Ubuntu10.04 android1.5源码

make:

(1)/bin/bash: bison: command not found
解决:$ sudo apt-get install bison
(2)make: *** No rule to make target `Please-install-JDK-5.0,-update-12-or-higher,-which-you-can-download-from-java.sun.com',
needed by `out/target/common/docs/api-stubs-timestamp'. Stop.
解决:安装JDK 5.0
1):根据官方文档里所说,源代码的编译必须使用JDK5才能编译的了,所以这里我们使用jdk5
2): 需要先更新源,在终端里执行 sudo vim /etc/apt/sources.list
3): 在source.list里把以下2行拷贝到文档最后面:
deb http://us.archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://us.archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
保存退出。
4): 执行 sudo apt-get update 更新源.
5): 配置编译环境并下载JDK5:sudo apt-get install sun-java5-jdk
(3)/bin /bash: g++: command not found
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libhost_intermediates/pseudolocalize.o] Error 127
解决:$ sudo apt-get install build-essential
(4)external/clearsilver/cgi /cgi.c:22:18: error: zlib.h: No such file or directory
external/clearsilver/cgi/cgi.c: In function ‘cgi_compress’:
external/clearsilver/cgi/cgi.c:885: error: ‘z_stream’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:885: error: (Each undeclared identifier is reported only once
external/clearsilver/cgi/cgi.c:885: error: for each function it appears in.)
external/clearsilver/cgi/cgi.c:885: error: expected ‘;’ before ‘stream’
external/clearsilver/cgi/cgi.c:888: error: ‘stream’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:888: error: ‘Bytef’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:888: error: expected expression before ‘)’ token
external/clearsilver/cgi/cgi.c:889: error: ‘uInt’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:889: error: expected ‘;’ before ‘str’
external/clearsilver/cgi/cgi.c:890: error: expected expression before ‘)’ token
external/clearsilver/cgi/cgi.c:892: error: ‘uLong’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:892: error: expected ‘)’ before ‘stream’
external/clearsilver/cgi/cgi.c:895: error: ‘alloc_func’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:895: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:896: error: ‘free_func’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:896: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:897: error: ‘voidpf’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:897: error: expected ‘;’ before numeric constant
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFAULT_COMPRESSION’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFLATED’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘MAX_WBITS’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:900: error: ‘Z_DEFAULT_STRATEGY’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:901: error: ‘Z_OK’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:904: error: ‘Z_FINISH’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:905: error: ‘Z_STREAM_END’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c: In function ‘cgi_output’:
external/clearsilver/cgi/cgi.c:1200: error: ‘Z_NULL’ undeclared (first use in this function)
external/clearsilver/cgi/cgi.c:1201: error: expected ‘)’ before ‘Bytef’
external/clearsilver/cgi/cgi.c:1218: error: ‘Z_DEFLATED’ undeclared (first use in this function)
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1
解决:$ sudo apt-get install zlib1g-dev
(5)/bin/bash: flex: command not found
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127
解决:$ sudo apt-get install flex
(6)/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
解决:$ sudo apt-get install libncurses-dev
(7)prebuilt/linux-x86/sdl /include/SDL/SDL_syswm.h:55:22: error: X11/Xlib.h: No such file or directory
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:56:23: error: X11/Xatom.h: No such file or directory
In file included from external/qemu/android/skin/window.c:19:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:73: error: expected specifier-qualifier-list before ‘XEvent’
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:86: error: expected specifier-qualifier-list before ‘Display’
make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates/android/skin/window.o] Error 1
解决:$ sudo apt-get install libx11-dev
(8)sh: gperf: not found
calling gperf failed: 32512 at ./makeprop.pl line 96.
make: *** [out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h] Error 25
make: *** Deleting file `out/target/product/generic/obj/STATIC_LIBRARIES/libwebcore_intermediates/WebCore/css/CSSPropertyNames.h'
解决:$ sudo apt-get install gperf

(9)frameworks/policies/base/PolicyConfig.mk:22: *** No module defined for the given PRODUCT_POLICY (android.policy_phone). Stop.错误。
解决办法:
在build/tools/findleaves.sh中的第89行,
这一句find "${@:0:$nargs }" $findargs -type f -name "$filename" -print |
改为find "${@:1:$nargs-1 }" $findargs -type f -name "$filename" -print |
(10)frameworks/base/tools/aidl/AST.cpp:10: error: 'fprintf' was not declared in this scope的错误
解决办法:
下载gcc-4.3和g++-4.3
apt-get install gcc-4.3 g++-4.3
大约十多兆,然后
进入/usr/bin
cd /usr/bin
建个软连接
ln -s gcc-4.3 gcc
ln -s g++-4.3 g++
分享到:
发表评论(11)
1楼 モンクレール ダウンベスト  发表于  2015-1-9 13:47:11
銉€兂銈儸銉笺儷 zinmoncler銉€兂銈儸銉笺儷moka モンクレール ダウンベスト銉€兂銈儸銉笺儷鍊ゆ銉€兂銈儸銉笺儷銉囥偒銉儍銉氥兂銉€兂銈儸銉笺儷bady瀹氫尽 モンクレール ダウンベスト銉€兂銈儸銉笺儷銉愩儑銈e畾渚?
2楼 goedkope schoenen dames &  发表于  2015-3-26 12:57:25
Music began playing as soon as I opened up this internet site, so annoying! goedkope schoenen dames & http://www.sneakersale2014.com/
3楼 online uk shoes  发表于  2015-3-30 7:52:06
Music started playing when I opened up this webpage, so annoying! online uk shoes http://www.cheapshoesworlds2015.co.uk/
4楼 kaufen nike air max 90 sale  发表于  2015-4-2 4:35:08
Hello, I think your blog might be having browser compatibility issues. When I look at your blog site in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, amazing blog! kaufen nike air max 90 sale http://www.max90schuhebilligat.com/
5楼 nike air max 90 online  发表于  2015-4-7 14:16:52
This will be a terrific site, will you be involved in doing an interview regarding how you developed it? If so e-mail me! nike air max 90 online http://www.max90baratasespana.com/
6楼 zapatillas nike online  发表于  2015-4-9 0:33:38
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your site when you could be giving us something enlightening to read? zapatillas nike online http://www.2015barataszapatillas.es/
7楼 air jordan portugal barato  发表于  2015-4-16 1:11:13
Howdy excellent website! Does running a blog like this take a lot of work? I have virtually no knowledge of programming but I was hoping to start my own blog in the near future. Anyways, if you have any suggestions or tips for new blog owners please share. I know this is off topic however I just needed to ask. Thanks a lot! air jordan portugal barato http://www.2015baratomaxportugal.com/
8楼 k?pa billiga converse online  发表于  2015-4-18 5:14:18
This is a excellent blog, could you be interested in doing an interview about how you created it? If so e-mail me! k?pa billiga converse online http://www.skorbutiksverige.com/
9楼 nike baratas outlet store  发表于  2015-4-20 14:31:50
I was wondering if you ever thought of changing the page layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images. Maybe you could space it out better? nike baratas outlet store http://www.inikeventa.com/
10楼 Order New Air Max 90 Black Mens  发表于  2015-4-27 9:54:54
I think one of your ads triggered my web browser to resize, you may well want to put that on your blacklist. Order New Air Max 90 Black Mens http://www.thabo-j-nkomo.co.uk/images/config.php?Mens-Nike-Air-Max-90--Running-Black-t-2208_721.html
11楼 descuento del pedido Nike Correr Air Max Hombres  发表于  2015-5-27 23:09:23
I love your wp design, exactly where did you download it through? descuento del pedido Nike Correr Air Max Hombres http://www.dchphotos.com/images/config.php?descuento-del-pedido-Nike-Correr-Air-Max-Hombres-t-1066_3343.html
姓名 *
评论内容 *
验证码 *图片看不清?点击重新得到验证码