[odroid-pc] ubuntu12.04 64bit Android4.0.3 原始碼編譯報錯及解決辦法

來源:互聯網
上載者:User

標籤:android

第一個錯誤:
        host Executable: cmu2nuance (out/host/linux-x86/obj/EXECUTABLES/cmu2nuance_intermediates/cmu2nuance)
        /usr/bin/ld: cannot find -lncurses
        collect2: ld returned 1 exit status
        make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
        make: *** Waiting for unfinished jobs....
        host Executable: coverage (out/host/linux-x86/obj/EXECUTABLES/coverage_intermediates/coverage)

        安裝libncurses5-dev:i386可以解決

        sudo apt-get install libncurses5-dev:i386

       編譯kernel源碼時出現如下錯誤:

        HOSTLD  scripts/kconfig/mconf
        scripts/kconfig/mconf.o: In function `show_help‘:
        mconf.c:(.text+0x811): undefined reference to `stdscr‘
        scripts/kconfig/mconf.o: In function `main‘:
        mconf.c:(.text+0x1286): undefined reference to `initscr‘
        mconf.c:(.text+0x128d): undefined reference to `stdscr‘
        scripts/kconfig/lxdialog/checklist.o: In function `print_arrows‘:
        checklist.c:(.text+0x41): undefined reference to `wmove‘
        checklist.c:(.text+0x61): undefined reference to `acs_map‘

        安裝libncurses5-dev可以解決

        sudo apt-get install libncurses5-dev

第二個錯誤:
      cc1plus: all warnings being treated as errors
    make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] 錯誤 1
    解決:通過SMBA伺服器進入並修改源碼目錄下/build/core/combo/HOST_linux-x86.mk檔案:

    將以下語句
    HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
    修改為
    HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

第三個錯誤:
    make: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach
    在工程根目錄下,開啟下面的makefile檔案:
    源碼目錄 frameworks/compile/slang/Android.mk
    .在開啟的makefile檔案中按照下面更改:
    #local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
    local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter

    原因很簡單 把警告當作error處理,所以此處要修改

第四個錯誤:
    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1

    solutions:external/mesa3d/src/glsl/linker.cpp
    +#include <stddef.h>
    #include <cstdlib>
    #include <cstdio>


第五個錯誤:
    In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0:
    external/oprofile/libpp/format_output.h:94:22: 錯誤: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
    make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] 錯誤 1

    修改external/oprofile/libpp/format_output.h:94行
        mutable counts_t & counts;
    改為:

        counts_t & counts;

第六個錯誤:

    target arm C: libc <= bionic/libc/bionic/pthread.c
    arm-linux-androideabi-gcc: error trying to exec ‘cc1‘: execvp: No such file or directory
    make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/libc_intermediates/bionic/pthread.o] Error 1

    gcc -print-prog-name=cc1   

    執行命令:export PATH=path/to/cc1:$PATH    


後面的錯誤及解決方案:參照http://www.cnblogs.com/xingfuzzhd/archive/2012/09/05/2672000.html

編譯成功後:

[email protected]:~# vim ~/.bashrc


在檔案中適當位置添加
#java 程式開發/啟動並執行一些環境變數
export ANDROID_PRODUCT_OUT=~/out/target/product/generic

ANDROID_PRODUCT_OUT_BIN=~/out/host/linux-x86/bin

export PATH=${PATH}:${ANDROID_PRODUCT_OUT_BIN}:${ANDROID_PRODUCT_OUT};
#以上為songjiachen添加20140303


[email protected]:~# source ~/.bashrc
[email protected]:~# cd ~/out/target/product/generic
[email protected]:~/out/target/product/generic# emulator -system system.img -data userdata.img -ramdisk ramdisk.img

emulator: WARNING: system partition size adjusted to match image file (166 MB > 66 MB)

此時模擬器已經成功運行

Could not configure ‘/dev/hpet‘ to have a 1024Hz timer. This is not a fatal
error, but for better emulation accuracy type:
‘echo 1024 > /proc/sys/dev/hpet/max-user-freq‘ as root.

[email protected]:~/out/target/product/generic# emulator -system system.img -data userdata.img -ramdisk ramdisk.img -partition-size 1024

此時模擬器已經成功運行 添加 -partition-size 1024為使=warning消除

直接輸入emulator也可

著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

[odroid-pc] ubuntu12.04 64bit Android4.0.3 原始碼編譯報錯及解決辦法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.