星期六, 十月 29, 2011

How to fix problem of incompatibility between GCC 4.6 and Android 2.3

How to fix problem of incompatibility between GCC 4.6 and Android 2.3
http://buildall.wordpress.com/2011/05/27/how-to-fix-problem-of-incompatibility-between-gcc-4-6-and-android-2-3-gingerbread/

Hello everybody. Let's see how we can fix one problem that can happen when you try to compile the Android 2.3 after you already have installed GCC 4.6.

During Android compilation you can receive the following error message:

host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
host SharedLib: libneo_cs (out/host/linux-x86/obj/lib/libneo_cs.so)
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function 'void android::RefBase::weakref_type::trackMe(bool, bool)':
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing 'const android::RefBase::weakref_impl' as 'this' argument of 'void android::RefBase::weakref_impl::trackMe(bool, bool)' discards qualifiers [-fpermissive]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1
make: *** Waiting for unfinished jobs....

To fix that, open a terminal and run (assuming you are in the folder android):

gedit frameworks/base/libs/utils/Android.mk

Change the line:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

To:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

After that, save the file and recompile the Android again.

That's it. See you next time.


星期二, 十月 25, 2011

如何安装Guest Addtions 在VirtualBox 和utunbu 11.10。

首先必须安装pae头文件


You can follow the steps below to install the guest additions program on your ubuntu 11.10:

1) Create a temp directory in your home directory
2) Copy the whole file into the temp directory from /media/VBo..
3) Sudo apt-get install linux-headers-3.0.0-12-generic-pae
 *Actually you get to make sure what kernel version on your machine
 *After that, make sure your get "linux-headers-3.0.0-12-generic-pae" tree in "usr/src"
4) Install the guest additions utility.

然后运行autorun.sh 编译并安装对应模块。
具体编译log可以查看/var/log/vboxadd-install.log
/usr/bin/VBoxClient× 系列软件,可以运行。
启动桌面后,即可粘帖了