yao3gang

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang  发布于  2016-03-16 21:19:58
采纳率 0%
1个问答
17005

【已解决】QT5.5.1交叉编译到海思平台,编译出错,头大啊!!!

 
本帖最后由 goodman 于 2016-3-21 15:52 编辑

CPU:hi3535
编译器:arm-hisiv100nptl-linux-gcc (Hisilicon_v100(gcc4.4-290+uclibc_0.9.32.1+eabi+linuxpthread)) 4.4.1

qtbase/mkspecs/:复制/拷贝 linux-arm-gnueabi-g++ 到 linux-hisiv100nptl-g++ 后修改
qmake.conf:
MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

# modifications to g++.conf
QMAKE_CC                = arm-hisiv100nptl-linux-gcc
QMAKE_CXX               = arm-hisiv100nptl-linux-g++
QMAKE_LINK              = arm-hisiv100nptl-linux-g++
QMAKE_LINK_SHLIB        = arm-hisiv100nptl-linux-g++

# modifications to linux.conf
QMAKE_AR                = arm-hisiv100nptl-linux-ar cqs
QMAKE_OBJCOPY           = arm-hisiv100nptl-linux-objcopy
QMAKE_NM                = arm-hisiv100nptl-linux-nm -P
QMAKE_STRIP             = arm-hisiv100nptl-linux-strip
load(qt_config)

qplatformdefs.h:
添加一行 #undef O_CLOEXEC

配置:./configure -v \
-xplatform linux-hisiv100nptl-g++ \
-prefix /opt/Qt-5.5.1/hisiv100nptl \
-opensource \
-confirm-license \
-c++11 \
-shared \
-largefile \
-accessibility \
-qt-sql-sqlite \
-qml-debug \
-no-sse2 \
-no-sse3 \
-no-ssse3 \
-no-sse4.1 \
-no-sse4.2 \
-no-avx \
-no-avx2 \
-no-mips_dsp \
-no-mips_dspr2 \
-mtdev \
-no-journald \
-no-openssl \
-widgets \
-no-optimized-qmake \
-no-cups \
-iconv \
-evdev \
-qt-libjpeg \
-nomake examples \
-make tools

出错打印:
在/qtwebkit/Source/WTF目录下
./wtf/unicode/wchar/UnicodeWchar.h: In function 'bool WTF::Unicode::isAlphanumeric(UChar)':
./wtf/unicode/wchar/UnicodeWchar.h:139: error: 'iswalnum' was not declared in this scope
........
还有一些和 'iswalnum' 类似的函数报错

我来回答
回答20个
时间排序
认可量排序

wuqingwei

0个粉丝

9

问答

0

专栏

0

资料

wuqingwei 2016-03-17 10:22:08
认可0
解决:

vi ./qtwebkit/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h

#ifndef ANDROID

/*add start*/

#include

typedef unsigned short int UChar;

/*add end*/

//# include

// typedef wchar_t UChar;

#else

typedef unsigned short int UChar;

#endif

ecomsbz

1个粉丝

22

问答

0

专栏

36

资料

ecomsbz 2016-03-17 13:49:30
认可0
感谢楼上,过来学习。

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-17 14:19:17
认可0
本帖最后由 yao3gang 于 2016-3-17 17:19 编辑

太感谢了 我先试试
又出现新的问题了
error :expected initializer before “throw”

我打开出错的头文件 signalfd.h
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  __nonnull  ((2))   __THROW;

我测试发现把 __nonnull  ((2)) 注释掉就可以,如下
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  /*__nonnull  ((2))*/   __THROW;

但是 __nonnull 和 __THROW 在 cdefs.h 都有定义啊  为什么__nonnull  ((2)) 会出错

#if __GNUC_PREREQ (3,3)
# define __nonnull(params) __attribute__ ((__nonnull__ params))
#else
# define __nonnull(params)
#endif

# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
#  define __THROW        __attribute__ ((__nothrow__))
#  define __NTH(fct)        __attribute__ ((__nothrow__)) fct
# else
#  if defined __cplusplus && __GNUC_PREREQ (2,8)
#   define __THROW        throw ()
#   define __NTH(fct)        fct throw ()
#  else
#   define __THROW
#   define __NTH(fct)        fct
#  endif
# endif


上面这个问题我自己解决了,在主机目录 /usr/include/i386-linux-gnu/sys/signalfd.h 文件中 signalfd 定义如下
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  __THROW __nonnull ((2));

而海思交叉编译工具目录下 signalfd.h 文件中 signalfd 定义如下
extern int signalfd (int __fd, const sigset_t *__mask, int __flags)
  __nonnull  ((2))   __THROW;

把 __nonnull  ((2))   和 __THROW 前后调换一下就可以了。不知道这样改有没有其他的问题,先这样吧

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-18 09:18:06
认可0
有出新问题了。多灾多难哦!!!!

In file included from html/track/LoadableTextTrack.cpp:36:
../WTF/wtf/RefPtr.h: In destructor 'WTF::RefPtr::~RefPtr() [with T = WebCore::TextTrackCueList]':
../WTF/wtf/RefPtr.h:62: sorry, unimplemented: inlining failed in call to 'WTF::RefPtr::~RefPtr() [with T = WebCore::TextTrackCueList]': recursive inlining
html/track/TextTrackCueList.h:45: sorry, unimplemented: called from here
make[3]: *** [.obj/html/track/LoadableTextTrack.o] Error 1
make[3]: Leaving directory `/home/hdb1/qt-everywhere-opensource-src-5.5.1/qtwebkit/Source/WebCore'
make[2]: *** [sub-Target-pri-make_first-ordered] Error 2
make[2]: Leaving directory `/home/hdb1/qt-everywhere-opensource-src-5.5.1/qtwebkit/Source/WebCore'
make[1]: *** [sub-Source-WebCore-WebCore-pro-make_first-ordered] Error 2
make[1]: Leaving directory `/home/hdb1/qt-everywhere-opensource-src-5.5.1/qtwebkit'
make: *** [module-qtwebkit-make_first] Error 2

goodman

2个粉丝

30

问答

18

专栏

17

资料

goodman 2016-03-18 10:58:39
认可0
4.4.1和4.6的编译器基本不支持C++11的特性,用c++98啊

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-18 14:26:36
认可0
make distclean
./configure  修改  把 -c++11 改为 -no-c++11,
make 还是一样报错啊

4.4.1和4.6的编译器基本不支持C++11的特性,用c++98啊 --- 具体怎么操作

goodman

2个粉丝

30

问答

18

专栏

17

资料

goodman 2016-03-18 16:20:50
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26824&ptid=10419]yao3gang 发表于 2016-3-18 14:26[/url]
make distclean
./configure  修改  把 -c++11 改为 -no-c++11,
make 还是一样报错啊
[/quote]

    -c++std .. Compile Qt with C++ standard edition (c++98, c++11, c++14, c++1z)
                         Default: highest supported


-c++std c++98

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-18 16:37:27
认可0
本帖最后由 yao3gang 于 2016-3-18 16:40 编辑

QT5.5.1 版本没有这个配置选项啊
./configure -help | grep c++
    -no-c++11 .......... Do not compile Qt with C++11 support enabled.
+  -c++11 ............. Compile Qt with C++11 support enabled.

我在qtbase/mkspecs/linux-hisiv100nptl-g++/qmake.conf 文件中添加了这一行,先试试看吧
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a -std=c++98

goodman

2个粉丝

30

问答

18

专栏

17

资料

goodman 2016-03-18 17:25:26
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26847&ptid=10419]yao3gang 发表于 2016-3-18 16:37[/url]
QT5.5.1 版本没有这个配置选项啊
./configure -help | grep c++
    -no-c++11 .......... Do not compil ...[/quote]

我看的是最新的QT 5.6.0,其他版本没有看

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-18 19:23:11
认可0
本帖最后由 yao3gang 于 2016-3-18 20:22 编辑

我在qtbase/mkspecs/linux-hisiv100nptl-g++/qmake.conf 文件中添加了这一行,先试试看吧
QMAKE_CXXFLAGS_RELEASE += -O2 -march=armv7-a -std=c++98

加了不行,还是5楼的问题
一咬牙 一跺脚 把ALWAYS_INLINE 注释了
./qtwebkit/Source/WTF/wtf/RefPtr.h  line:62
/*ALWAYS_INLINE*/ ~RefPtr() { derefIfNotNull(m_ptr); }

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-19 11:49:08
认可0
本帖最后由 yao3gang 于 2016-3-19 11:50 编辑

感谢各位兄弟,总算是编译过了,太艰难了。

tango_zhu

14个粉丝

14

问答

0

专栏

3

资料

tango_zhu 2016-03-19 15:52:42
认可0
楼主交叉编译是静态编译的吗?编译后的qt大小是多大的?有可能在32M的flash上跑吗?

goodman

2个粉丝

30

问答

18

专栏

17

资料

goodman 2016-03-19 20:33:14
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26890&ptid=10419]yao3gang 发表于 2016-3-19 11:49[/url]
感谢各位兄弟,总算是编译过了,太艰难了。[/quote]

很好,请将标题修改为【已解决】QT5.5.1交叉编译到海思平台,编译出错,头大啊!!!

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-21 12:09:00
认可0
本帖最后由 yao3gang 于 2016-3-21 12:10 编辑

问一句 怎么修改帖子标题? 我没找到哦

yao3gang

0个粉丝

1

问答

0

专栏

0

资料

yao3gang 2016-03-21 12:09:58
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26904&ptid=10419]tango_zhu 发表于 2016-3-19 15:52[/url]
楼主交叉编译是静态编译的吗?编译后的qt大小是多大的?有可能在32M的flash上跑吗?[/quote]


root@ubuntu:/opt/Qt-5.5.1/hisiv100nptl# pwd
/opt/Qt-5.5.1/hisiv100nptl
root@ubuntu:/opt/Qt-5.5.1/hisiv100nptl# du -h -d0 *
32M        bin
548K        doc
440K        imports
32M        include
79M        lib
2.8M        mkspecs
4.6M        plugins
788K        qml
9.9M        translations

这是编译以后各个目录的大小,你的应用也不是每个库文件都用到的,这个要看你的应用,我是这么认为的。

goodman

2个粉丝

30

问答

18

专栏

17

资料

goodman 2016-03-21 15:52:16
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26992&ptid=10419]yao3gang 发表于 2016-3-21 12:09[/url]
问一句 怎么修改帖子标题? 我没找到哦[/quote]

主题从新编辑,然后更改

haisilinux

0个粉丝

3

问答

0

专栏

0

资料

haisilinux 2016-03-22 15:19:57
认可0
你编译完了 79M的 库? 太大了吧

jsxyhyj

0个粉丝

3

问答

0

专栏

1

资料

jsxyhyj 2016-06-28 16:58:54
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26736&ptid=10419]yao3gang 发表于 2016-3-17 14:19[/url]
太感谢了 我先试试
又出现新的问题了
error :expected initializer before “throw”
[/quote]

把 __nonnull  ((2))   和 __THROW 前后调换一下就可以了。不知道这样改有没有其他的问题,先这样吧

你好,请问你是改的这个文件吗?
/opt/hisi-linux-nptl/arm-hisiv100-linux/bin/../target/usr/include/sys/signalfd.h  



leilc

0个粉丝

2

问答

0

专栏

1

资料

leilc 2016-06-29 17:08:03
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=26904&ptid=10419]tango_zhu 发表于 2016-3-19 15:52[/url]
楼主交叉编译是静态编译的吗?编译后的qt大小是多大的?有可能在32M的flash上跑吗?[/quote]

Qt5.7, 静态编译了一个空壳的界面程序,12M。控制台的hello world大小是4M
我是想做GUI,所以32M应该够跑。如果做复杂的程序就难说了。

cy_ygs

0个粉丝

0

问答

0

专栏

0

资料

cy_ygs 2016-12-26 15:58:39
认可0
学习学习,支持
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区