一,安装环境:

  sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32z1 lib32ncurses5 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc ctags cscope

二,测试编译:

1、用gedit或其它文本编辑器创建下述test.c文件

//file name: test.c

#include<stdio.h>

      int main()
      {
        printf("Hello world\n");
        return 0;
      }

2、用gcc编译器编译

gcc -o test test.c

3、试运行编译好的文件,如果输出Hello Ubuntu!,说明系统可以编译c程序。

./test

三,查看编译工具版本信息:  

$ gcc --version
gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2

$ g++ --version
g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2

$ gdb --version
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1

四,ubuntu14.04 64bit 安装交叉编译环境不识别

  解压,设置好环境变量后,#arm-none-linux-gnueabi-gcc -v 提示找不到编译器,原因是编译器是32bit的,而装的是64bit系统。

  google后说要装ia32-libs,(http://andycoder.me/fix-32bug-under-ubuntu1404/)

  但却一直装不上,终端提示替代品:lib32z1 lib32ncurses5 lib32bz2-1.0

  安装完这三个替代品后,就可以识别交叉编译器了。

五,编译xloader出错

/home/oee/arm-tool/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':
(.text+0x8): undefined reference to `raise'
make: *** [x-load] Error 1

http://www.crifan.com/uboot_cross_compile_gcc_config_arm_lib1funcs_asm_undefined_reference_to_raise/

解决办法两种:

1.去用其他对应的配置(估计是用于指定是非GUN/Linux类程序的),重新编译一个新版本的交叉编译器,然后用新的非GNU/Linux的交叉编译器,去编译此旧版本的uboot,即可正常编译

2.修改自己的uboot,加上对应的(随便写个空的)__aeabi_ldiv0或raise函数即可。

此处选用第二种,具体做法:

此处的uboot是whgs的(即配置的时候用的是make whgs_config)

所以找到对应的汇编文件,即:

board/whgs/lowlevel_init.S

在文件最后,添加上

@add empty raise() to fix (when use new EABI xscale cross compiler to) compile
@error gcc/config/arm/lib1funcs.asm:1266: undefined reference to `raise'
.globl raise
raise:
	nop
	mov	pc, lr

然后重新编译,即可。

六,编译android时报错

oee@copener:/opt/ns115_jb/android$ make clean
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
build/core/config.mk:342: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com. Stop.

  代码复制过来,权限有问题

  $chmod -R 700 android/

七,JDK版本不对应

oee@copener:/opt/ns115_jb/android$ make clean
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux---generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=JOP40C
OUT_DIR=out
============================================
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version
of java.

Your version is: java version "1.8.0_40".
The correct version is: Java SE 1.6.

Please follow the machine setup instructions at
    https://source.android.com/source/download.html
************************************************************
build/core/main.mk:: *** stop.  Stop.
oee@copener:/opt/ns115_jb/android$ 

查找除错代码:

$ vim Makefile

发现调用的是main.mk

$ vim build/core/main.mk

# Check for the correct version of java
java_version := $(shell java -version >& |  | grep '^java .*[ "]1\.6[\. "$$]')
ifneq ($(shell java -version >& | grep -i openjdk),)
java_version :=
endif
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(>& | ).)
$(info The correct version is: Java SE 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
$(info ************************************************************)
$(error stop)
endif

# Check for the correct version of javac
javac_version := $(shell javac -version >& |  | grep '[ "]1\.6\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(>& | ).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
$(info ************************************************************)
$(error stop)
endif

把版本号改一下

# Check for the correct version of java
java_version := $(shell java -version >& |  | grep '^java .*[ "]1\.8[\. "$$]')
ifneq ($(shell java -version >& | grep -i openjdk),)
java_version :=
endif
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(>& | ).)
$(info The correct version is: Java SE 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
$(info ************************************************************)
$(error stop)
endif

# Check for the correct version of javac
javac_version := $(shell javac -version >& |  | grep '[ "]1\.8[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(>& | ).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)https://source.android.com/source/download.html)
$(info ************************************************************)
$(error stop)
endif

版本太新,不支持

Export includes file: frameworks/base/libs/androidfw/Android.mk -- out/host/linux-x86/obj/STATIC_LIBRARIES/libandroidfw_intermediates/export_includes

make: *** Waiting for unfinished jobs....
javac: target release 1.5 conflicts with default source release 1.8

javac: target release 1.5 conflicts with default source release 1.8

javac: target release 1.5 conflicts with default source release 1.8

ERROR: build project failed

换回原来的JDK版本  1.6.0_31

八,编译android出错:

vendor/dlna/src/avahi/avahi-daemon/static-services.c::: note: expected 'char *' but argument is of type 'char const *'
vendor/dlna/src/avahi/avahi-daemon/static-services.c::: warning: passing argument  of 'load_file' discards 'const' qualifier from pointer target type [enabled by default]
vendor/dlna/src/avahi/avahi-daemon/static-services.c::: note: expected 'char *' but argument is of type 'char const *'
target thumb C: avahi-daemon <= vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c
target thumb C: avahi-daemon <= vendor/dlna/src/avahi/avahi-daemon/../avahi-client/check-nss.c
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c: In function 'sd_is_socket':
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c: In function 'sd_is_socket_inet':
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c: In function 'sd_is_socket_unix':
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c: In function 'sd_notify':
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: unused parameter 'unset_environment' [-Wunused-parameter]
vendor/dlna/src/avahi/avahi-daemon/sd-daemon.c::: warning: unused parameter 'state' [-Wunused-parameter]
target thumb C: avahi-daemon <= vendor/dlna/src/avahi/avahi-daemon/dbus-protocol.c
target thumb C: avahi-daemon <= vendor/dlna/src/avahi/avahi-daemon/dbus-util.c
target thumb C: avahi-daemon <= vendor/dlna/src/avahi/avahi-daemon/dbus-async-address-resolver.c
vendor/dlna/src/avahi/avahi-daemon/dbus-protocol.c::: fatal error: dbus/dbus.h: No such file or directory
compilation terminated.

make: *** 正在等待未完成的任务....
In ::
vendor/dlna/src/avahi/avahi-daemon/../avahi-common/dbus.h::: fatal error: dbus/dbus.h: No such file or directory
compilation terminated.
In ::
vendor/dlna/src/avahi/avahi-daemon/../avahi-common/dbus.h::: fatal error: dbus/dbus.h: No such file or directory
compilation terminated.

make: *** wait: 没有子进程。 停止。
ERROR: build project failed
oee@copener:/opt/ns115_jb/android$ 

提示:fatal error: dbus/dbus.h: No such file or directory

sudo apt-get install libexpat1-dev

sudo apt-get install libdbus-glib-1-dev

root@copener:/usr/include/dbus-1.0# cp -r dbus/ ../../include/dbus

apt-get install d-feet

apt-get install libgtk2.0-dev

apt-get install libdbus-glib-1-dev

root@copener:/usr/include/dbus-1.0# find / -name dbus-arch-deps.h

root@copener:/usr/include/dbus-1.0# cp -r /usr/lib/x86_64-linux-gnu/dbus-1.0/include/dbus/ ../../include/

root@copener:/usr/include/dbus# cp dbus-arch-deps.h ../dbus

ns115 step by step的更多相关文章

  1. Step by step Dynamics CRM 2011升级到Dynamics CRM 2013

    原创地址:http://www.cnblogs.com/jfzhu/p/4018153.html 转载请注明出处 (一)检查Customizations 从2011升级到2013有一些legacy f ...

  2. Step by Step 创建一个新的Dynamics CRM Organization

    原创地址:http://www.cnblogs.com/jfzhu/p/4012833.html 转载请注明出处 前面演示过如何安装Dynamics CRM 2013,参见<Step by st ...

  3. Step by step Install a Local Report Server and Remote Report Server Database

    原创地址:http://www.cnblogs.com/jfzhu/p/4012097.html 转载请注明出处 前面的文章<Step by step SQL Server 2012的安装 &g ...

  4. Step by step Dynamics CRM 2013安装

    原创地址:http://www.cnblogs.com/jfzhu/p/4008391.html 转载请注明出处   SQL Server可以与CRM装在同一台计算机上,也可安装在不同的计算机上.演示 ...

  5. Step by step 活动目录中添加一个子域

    原创地址:http://www.cnblogs.com/jfzhu/p/4006545.html 转载请注明出处 前面介绍过如何创建一个域,下面再介绍一下如何在该父域中添加一个子域. 活动目录中的森林 ...

  6. SQL Server 维护计划实现数据库备份(Step by Step)(转)

    SQL Server 维护计划实现数据库备份(Step by Step) 一.前言 SQL Server 备份和还原全攻略,里面包括了通过SSMS操作还原各种备份文件的图形指导,SQL Server  ...

  7. 转:eclipse以及step into step over step return的区别

    首先来讲一下step into step over step return的区别: step into就是单步执行,遇到子函数就进入并且继续单步执行:(F5) step over是在单步执行时,在函数 ...

  8. [转]Bootstrap 3.0.0 with ASP.NET Web Forms – Step by Step – Without NuGet Package

    本文转自:http://www.mytecbits.com/microsoft/dot-net/bootstrap-3-0-0-with-asp-net-web-forms In my earlier ...

  9. EF框架step by step(7)—Code First DataAnnotations(2)

    上一篇EF框架step by step(7)—Code First DataAnnotations(1)描述了实体内部的采用数据特性描述与表的关系.这一篇将用DataAnnotations描述一下实体 ...

  10. EF框架step by step(6)—处理实体complex属性

    上一篇的中介绍过了对于EF4.1框架中,实体的简单属性的处理 这一篇介绍一下Code First方法中,实体Complex属性的处理.Complex属性是将一个对象做为另一个对象的属性.映射到数据库中 ...

随机推荐

  1. 关于Erlang中的behaviour

    唔,听说过这四个牛逼渣渣的behaviour:gen_server,gen_fsm,gen_event,supervisor.所以也就更加好奇behaviour的实现. 在解释它是怎么工作的之前,我们 ...

  2. TortoiseSVN文件夹及文件图标不显示解决方法

              由于自己的电脑是win7(64位)的,系统安装TortoiseSVN之后,其他的功能都能正常的使用,但是就是文件夹或文件夹的左下角就是不显示图标,这个问题前一段时间就遇到了(那个时 ...

  3. jquery 显示弹出层可利用动画效果

    1 show()方法和hide()方法 $("selector").show()  从display:none还原元素默认或已设置的display属性$("selecto ...

  4. win7下Outlook2010禁止访问具有潜在不安全因素的附件的解决办法

    发生情景: 收到.bat .exe等敏感类型附件时,会碰到此问题. 解决方法: 1.打开regedit.exe 2.依次展开HKEY_CURRENT_USER\Software\Microsoft\O ...

  5. 【visio 2007操作】

    1.visio改变画布大小 两种方法:1)按住ctrl,可以鼠标拉动调整背景绘图大小2)点击菜单栏“文件”-“页面尺寸”,选择“调整大小以适应绘图内容”并点击确定

  6. unslider.js 实现移动web轮播

    unslider.js可以实现轮播,但是在移动端还需要另两个插件. jquery.event.move和jQuery.event.swipe : 下面就是简单的实例: <!doctype htm ...

  7. C语言程序设计第5堂作业

    一.本次课学习主要内容及知识结构点: 二.实验内容:(60分) 1. 求奇数和.输入一批正整数(以零或负数为结束标志),求其中的奇数和.试编写相应程序. 2. 展开式求和.输入一个实数 x,计算并输出 ...

  8. Linq学习总结2--Linq to XML

    概述: linq to xml(下面简称ltx好了),是微软根据linq技术对于XML的CURD.使用起来比System.XML中的XML操作方式更加简便.这段时间使用它在公司里升级了老板的邮件系统, ...

  9. Rails学习笔记一

    安装篇: 下载railsintalls 这里我下载的是rubyinstaller-1.9.3-p448 安装后,安装SQLite3数据库 下载sqlite3.def sqlite3.dll sqlit ...

  10. 深入理解JavaScript系列:JavaScript的构成

    此篇文章不是干货类型,也算不上概念阐述,就是简单的进行一个思路上的整理. 要了解一样东西或者完成一件事情,首要的就是先要搞清楚他是什么.作为一个前端开发人员,JavaScript应该算作是最核心之一的 ...