ubuntu14.04编android2.3.1的一些坑

1、

apt-cache policy name
获得已安装的name 的version

2、android 2.3.1在ubuntu14.04上编译的错误

*gcc 不对:安装4.4的gcc和g++

*Zgnote.c报错:用下面的patch

diff --git a/vm/native/dalvik_system_Zygote.c b/vm/native/dalvik_system_Zygote.c
index bcc2313..112563a 100644
--- a/vm/native/dalvik_system_Zygote.c
+++ b/vm/native/dalvik_system_Zygote.c
@@ -21,6 +21,7 @@
 #include "native/InternalNativePriv.h"
 
 #include <signal.h>
+#include <sys/resource.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <grp.h>

*/usr/bin/ld: cannot find -lcurse

apt-get install lib32ncurses5    

*/usr/bin/ld: cannot find -lz

sudo apt-get install lib32z1-dev

*/usr/include/zlib.h:34:19: fatal error: zconf.h: 没有那个文件或目录

有一处少了一个头文件,原因是zlib1g-dev有个头文件修改了路径,及zconf.h放到了/usr/include/x86_64-linux-gnu/,所以将其拷贝到/usr/include/下即可了

*Can't locate Switch.pm in

sudo apt-get install libswitch-perl

*Unknown parameter

gcc版本太高,用update-alternative配置一下

*In file included from /usr/include/stdlib.h:24,
                 from build/tools/acp/acp.c:11:
/usr/include/features.h:374: fatal error: sys/cdefs.h: No such file or directory

sudo apt-get install libc6-dev-i386

G++: selected multilib '32' not installed.
Problem when installing CACTI
G++: selected multilib '32' not installed.
Install the multilib for g++
In Ubuntu, we just input 


 sudo apt-get install g++-multilib
However, the g++ we use is not the latest version, it is g++ - 4.4, so we should also install this. 
Just 
 sudo apt-get install g++-4.4-multilib






你可能感兴趣的:(ubuntu14.04编android2.3.1的一些坑)