今天开始正式干活了

拿到一个全志Tina的板子还有一个SDK压缩包,要求我这周(只剩一天半。。。)就要把sdk编译通过并且把板子跑起来。

还特别跟我说他们试了下这个sdk编译没法通过,会报错。。。

竟然是有坑!

————————————————————————————————————————————————————————————————

准备工作:

拷贝解压SDK

阅读Guide手册(如何配置环境,如何编译,如何烧录)

读完了接下来正式开工

第一步,配置编译环境。

但是老子是ssh远程编译服务器编译,没有全向apt-install,问老大,老大说应该配好了,叫我先编译一下试试看。

应该?好吧,先略过。

第二步,编译

还好编译的时候回自动检测编译环境是否配置ok。

按照手册开始一步一步编译,问了下公司的服务器只有4核,为了不影响其他人使用,在这里只能make -j4编译。

之后就是等待结果。。同时可以去找找烧录套件准备硬件连接。

 $ tar -xvf Homlet-Tina-H2_H3
$ cd Homlet-Tina-H2_H3
$ source build/envsetup.sh
$ lunch dolphin_p1-tina
$ make –j4

编译了大概13分钟之后就Error报错了!

停止编译了!

In file included from /usr/include/libxml2/libxml/parser.h:810:0,
from /usr/include/libxml2/libxml/globals.h:18,
from /usr/include/libxml2/libxml/threads.h:35,
from /usr/include/libxml2/libxml/xmlmemory.h:218,
from /usr/include/libxml2/libxml/tree.h:1307,
from mxmlds.c:22:/usr/include/libxml2/libxml/encoding.h:31:26: fatal error: unicode/ucnv.h: No such file or directory
compilation terminated.
Makefile:393: recipe for target 'mxmlds.lo' failed
make[6]: *** [mxmlds.lo] Error 1
make[6]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/compile_dir/target/libmgncs-1.2.0/src/datasource'
Makefile:624: recipe for target 'install-recursive' failed
make[5]: *** [install-recursive] Error 1
make[5]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/compile_dir/target/libmgncs-1.2.0/src'
Makefile:487: recipe for target 'install-recursive' failed
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/compile_dir/target/libmgncs-1.2.0'
Makefile:95: recipe for target '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/compile_dir/target/libmgncs-1.2.0/.built' failed
make[3]: *** [/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/compile_dir/target/libmgncs-1.2.0/.built] Error 2
make[3]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/package/minigui/libmgncs'
package/Makefile:192: recipe for target 'package/minigui/libmgncs/compile' failed
make[2]: *** [package/minigui/libmgncs/compile] Error 2
make[2]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3'
package/Makefile:189: recipe for target '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/staging_dir/target/stamp/.package_compile' failed
make[1]: *** [/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/out/dolphin-p1/staging_dir/target/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3'
Build failed - please re-run with -j1 to see the real error message
/home/liuxueneng/WorkCode/Homlet-Tina-H2_H3/build/toplevel.mk:275: recipe for target 'world' failed
make: *** [world] Error 1 #### make failed to build some targets (12:27 (mm:ss)) ####

看报错是在编译 libmgncs-1.2.0源码包的mxmlds.c的时候跟踪到encoding.h但是找不到被包含的头文件unicode/ucnv.h

打开mxmlds.c看一下,含有以下几个头文件其中tree.h和parser.h都包含了encoding.h

#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/parser.h>

编译该源码包的时候指向的头文件路径是 /usr/include/libxml2/libxml/encoding.h

看下头文件

/*
2 * Summary: interface for the encoding conversion functions
3 * Description: interface for the encoding conversion functions needed for
4 * XML basic encoding and iconv() support.
5 *
6 * Related specs are
7 * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
8 * [ISO-10646] UTF-8 and UTF-16 in Annexes
9 * [ISO-8859-1] ISO Latin-1 characters codes.
10 * [UNICODE] The Unicode Consortium, "The Unicode Standard --
11 * Worldwide Character Encoding -- Version 1.0", Addison-
12 * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
13 * described in Unicode Technical Report #4.
14 * [US-ASCII] Coded Character Set--7-bit American Standard Code for
15 * Information Interchange, ANSI X3.4-1986.
16 *
17 * Copy: See Copyright for the status of this software.
18 *
19 * Author: Daniel Veillard
20 */
21
22 #ifndef __XML_CHAR_ENCODING_H__
23 #define __XML_CHAR_ENCODING_H__
24
25 #include <libxml/xmlversion.h>
26
27 #ifdef LIBXML_ICONV_ENABLED
28 #include <iconv.h>
29 #endif
30 #ifdef LIBXML_ICU_ENABLED
31 #include <unicode/ucnv.h>
32 #endif
33 #ifdef __cplusplus
34 extern "C" {
35 #endif

发现里面有个宏 LIBXML_ICU_ENABLED开关控制unicode/ucnv.h的包含,控制ICU的功能是否需要enable。

现在报错找不到unicode/ucnv.h说明这个宏被人定义了,但是在sdk目录下搜索LIBXML_ICU_ENABLED 关键字的文件只有两个,其中xmlversion.h明确屏蔽了这个宏

./package/allwinner/liballwinner_tina/liballwinner/LIBRARY/EXTERNAL/include/libxml/encoding.h
./package/allwinner/liballwinner_tina/liballwinner/LIBRARY/EXTERNAL/include/libxml/xmlversion.h
/**
* LIBXML_ICU_ENABLED:
*
* Whether icu support is available
*/
#if 0
#define LIBXML_ICU_ENABLED
#endif

上面两个文件和指定目录的文件是同一个类型,只是不同版本,查看指定路径头文件/usr/include/libxml2/libxml/xmlversion.h,发现里面打开了这个宏。

/**
281 * LIBXML_ICU_ENABLED:
282 *
283 * Whether icu support is available
284 */
285 #if 1
286 #define LIBXML_ICU_ENABLED
287 #endif

原本可以在指定的头文件里屏蔽掉这个宏重新编译就可以了。

但是这个是编译服务器的系统头文件

首先没有权限修改。

其次为了编译某个项目屏蔽公用的头文件功能对别人使用会有影响。

最重要的是这个sdk编译完了要打包烧录到arm板子上,最好不要依赖牵涉宿主机上的东西,所有依赖自带并打包才更符合逻辑。

--------------------------------------------------------------------------------------------------------------------------------------------------

问题原因找到了,解决办法就是修改头文件指定目录。

现在需要找到头文件路径设置的地方进而修改。

整个sdk编译走的都是Makefile结构,头文件路径有些是从父级环境变量继承下来的,有些是子目录源码自己添加的。

查看出问题的源码Makefile发现了CPPFLAGS里面就是包含了刚才那个系统头文件目录

 /usr/include/libxml2/libxml

但是改这个Makefile是没有任何意义的,因为Makefile文件是configure之后自动产生的,所以这个应该问题和configure有关

看下源码libmgncs-1.2.0目录下的configure文件(重新解压未编译过的)果然发现了里面自带的configure.as包含这个固定路径

if test "x$build_datasource_xml" = "xyes"; then
AC_DEFINE(_MGNCSDB_DATASOURCE, 1,
[Define if support datasource])
AC_DEFINE(_MGNCSDB_XML, 1,
[Define if support xml datasource])
CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
fi

现在只要把这个头文件地址改到自己指定的libxml2目录就可以了

CPPFLAGS="$CPPFLAGS -I../../../../package/allwinner/liballwinner_tina/liballwinner/LIBRARY/EXTERNAL/include/libxml"

重新configure 编译就通过了。

接下来就是准备烧录验证硬件了。。。

全志TinaLinux编译错误fatal error: unicode/ucnv.h: No such file or directory的更多相关文章

  1. fatal error: openssl/bn.h: No such file or directory

    出现如下错误 fatal error: openssl/bn.h: No such file or directory 解决办法 # sudo apt-get install libssl-dev

  2. 【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

    [Redis]编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory 在安装redis进行编译 ...

  3. 编译内核时出现drivers/mfd/mxc-hdmi-core.c:36:24: fatal error: mach/clock.h: No such file or directory

    在学习恩智浦IMX6D开发板时,编译内核出现 drivers/mfd/mxc-hdmi-core.c::: fatal error: mach/clock.h: No such file or dir ...

  4. ubuntu16.04 编译出错:fatal error: SDL/SDL.h: No such file or directory

    在ubuntu 16.04编译神经网络代码时候,遇到了这样一种错误? fatal error: SDL/SDL.h: No such file or directory 原因是SDL库没有安装,根据你 ...

  5. cocos2d-x 移植到android中编译的一些问题:fatal error: Box2D/Box2D.h: No such file or directory&quot;

    1.fatal error: Box2D/Box2D.h: No such file or directory" 须要加入box2d库的支持,改动android.mk文件,例如以下: 查看文 ...

  6. 解决Ubuntu16.04 fatal error: json/json.h: No such file or directory

    参考博客 错误产生 安装json-c库之后,根据GitHub上面的readme文件链接到json-c库时出现以下错误: SDMBNJson.h:9:23: fatal error: json/json ...

  7. fatal error: sys/videoio.h: No such file or directory

    Determining if the include file sys/videoio.h exists failed with the following output:Change Dir: /h ...

  8. fatal error: openssl/sha.h: No such file or directory 解决方案

    出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries, ...

  9. lua.c:80:31: fatal error: readline/readline.h: No such file or directory

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

随机推荐

  1. layui日期选择无效的问题

    解决layui引入时间控件无效的问题 - 简书 (jianshu.com) 原因是因为在使用日期选择器的时候,layui源码里有一个laydate.css文件找不到 将下载的文档文件里的css文件夹, ...

  2. [Python]爬虫获取知乎某个问题下所有图片并去除水印

    获取URL 进入某个知乎问题的主页下,按F12打开开发者工具后查看network面板. network面板可以查看页面向服务器请求的资源.资源的大小.加载资源花费的时间以及哪些资源加载失败等信息.还可 ...

  3. cnblogs-theme-silence 主题设置简约风格

    本文参考 更改博客皮肤 更改博客皮肤为Custom 页面定制CSS代码 勾选禁用模板默认CSS 导入复制该文件内容到代码框中 配置代码块复制功能 样式 和 右侧滑动条样式 /*复制功能添加按钮 beg ...

  4. VBox 虚拟机安装 Openwrt 做旁路由

    VBox 虚拟机安装 Openwrt 做旁路由 需求:开个虚拟机做旁路由,电脑把网关设置成旁路由地址,用它跑个上网或其他什么东西. 安装及配置过程简述 这件事流程很简单,总结起来主要有以下几点: 安装 ...

  5. ESP8266- ESP01之AT固件下载及其他问题

    注意: 本文基于淘宝上买的安信可原装ESP-01,文章中出现的问题在另一片ESP-01S上均未出现.由于在刷固件前没有进行完整测试,因此无法判断是固件导致的还是版本不同造成的. 问题: 1.发热严重. ...

  6. 深入xLua实现原理之C#如何调用Lua

    本文主要是探讨xLua下C#调用Lua的实现原理,有关Lua如何调用C#的介绍可以查看深入xLua实现原理之Lua如何调用C# C#与Lua数据通信机制 无论是Lua调用C#,还是C#调用Lua,都需 ...

  7. win10连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    win10中cmd连接mysql提示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YE ...

  8. adb devices如何连逍遥模拟器的设备

    adb device连接真机,上一篇已经讲过了,这篇讲如何连接模拟器.这里我用的模拟器逍遥模拟器.我先插上手机,另外启动了一个模拟器,直接在cmd中输入adb devices,按理应该有2个设备id, ...

  9. display:flex;下的子元素width无效问题

    因为flex属性默认值为flex:0 1 auto;其中 1 为 flex中的 flex-shrink 属性. 该属性介绍: 一个数字,规定项目将相对于其他灵活的项目进行收缩的量. 根据上述介绍可以理 ...

  10. 案例分享 | dubbo 2.7.12 bug导致线上故障

    本文已收录 https://github.com/lkxiaolou/lkxiaolou 欢迎star.搜索关注微信公众号"捉虫大师",后端技术分享,架构设计.性能优化.源码阅读. ...