Android build error on ubuntu 11.10

I ran into a problem while trying to build Android 2.3 on ubuntu 11.10

The first mistake is

frameworks / base / libs / utils / RefBase.cpp: 483: 67: error: passing 'const android :: RefBase :: weakref_impl as' this argument' 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 incomplete tasks ....

I solved this by changing

frameworks / basic / LIBS / Utils / Android.mk LOCAL_CFLAGS + = -DLIBUTILS_NATIVE = 1 $ (TOOL_CFLAGS) LOCAL_CFLAGS + = -DLIBUTILS_NATIVE = 1 $ (TOOL_CFLAGS) -fpermissive

But after performing the above modification, a new error occurred,

host SharedLib: libneo_cgi (out / host / linux-x86 / obj / lib / libneo_cgi.so)

host C ++: libutils <= frameworks / base / libs / utils / Asset.cpp

host C ++: libutils <= frameworks / base / libs / utils / AssetDir.cpp

host C ++: libutils <= frameworks / base / libs / utils / AssetManager.cpp

g ++: error: unrecognized option '--fpermissive

make: * [out / host / linux-x86 / obj / STATIC_LIBRARIES / libutils_intermediates / Asset.o] Error 1 make: * Waiting for work in progress ....

g ++: error: unrecognized option --fpermissive g ++: error: unrecognized option --fpermissive

make: * [out / host / linux-x86 / obj / STATIC_LIBRARIES / libutils_intermediates / AssetDir.o] Error 1

make: * [out / host / linux-x86 / obj / STATIC_LIBRARIES / libutils_intermediates / AssetManager.o]

Build configuration: Ubuntu 11.10 I tried both versions of gcc, 4.4 and 4.6 but nothing works, please help me deal with the last day.

Command parameters used to build,

$. build /envsetup.sh

$ lunch 1

$ make -j4

GCC Version

gcc -v Use inline specifications. COLLECT_GCC = NKA COLLECT_LTO_WRAPPER = / USR / Library / GCC / i686-Linux-GNU / 4.6.1 / LTO-wrapper Purpose: i686-linux-gnu Configured with: ../ src / configure -v --with-pkgversion = 'Ubuntu / Linaro 4.6.1-9ubuntu3' --with-bugurl = file: ///usr/share/doc/gcc-4.6/README. Errors --enable-languages ​​= c, C ++, fortran, objc, obj-C ++, go --prefix = / usr --program-suffix = -4.6 --enable-shared --enable-linker -build-id - c-system-zlib --libexecdir = / usr / lib --without-included-gettext --enable-threads = posix --with-gxx-include-dir = / usr / include / C ++ /4.6 --libdir = / usr / lib --enable-nls --with-sysroot = / - enable-clocale = gnu --enable-libstdcxx-debug --enable-libstdcxx-time = yes --enable-plugin --enable-objc-gc --enable-targets = all --disable-werror --with-arch-32 = i686 --with-tune = generic --enable-checking = release --build = i686-linux- gnu --host = i686- linux-gnu --target = i686-linux-gnu Thread model: posix gcc version 4.6.1 (Ubuntu / Linaro 4.6.1-9ubuntu3)

-------------------------------------------- ------ -------------- EDIT 2 -

I think this is a problem with the gcc version and not its promotion at a better pace, but now I get this error - cmd - make CC=gcc-4.4 CXX=g++-4.4

the error is host SharedLib: libneo_cgi (out/host/linux-x86/obj/lib/libneo_cgi.so) /usr/bin/ld: cannot find -lz collect2: ld returned 1 exit status make: *** [out/host/linux-x86/obj/lib/libneo_cgi.so] Error 1

+4
source share
1 answer

I tried this solution and it solved the problem you mentioned: How to fix the incompatibility problem between GCC 4.6 and Android 2.3 (Gingerbread) .

However, I cannot link after everything is compiled. I am compiling 2.2 with gcc-4.6 on linux mint.

In any case, this should help you.

+2
source

Source: https://habr.com/ru/post/1390174/


All Articles