野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 26880|回复: 3

[求助] Ubuntu20.04与QT交叉编译出错寻求帮助

[复制链接]
发表于 2021-5-13 10:22:53 | 显示全部楼层 |阅读模式
我按野火学习Qt交叉编译环境搭建,安装到交叉编译Qt,出现如下错误“no matching function for call to ‘std::mersenne_twister_engine”:请问是我的Ubuntu版本20.04的问题么,一定要用18.04才行吗?跪求大神指点。具体错误提示如下:
Creating qmake...
./home/ubuntu/Qtlinux/qt-everywhere-src-5.11.3/qtbase/src/corelib/global/qrandom.cpp: In static member function ‘static void QRandomGenerator::SystemAndGlobalGenerators::securelySeed(QRandomGenerator*)’:
/home/ubuntu/Qtlinux/qt-everywhere-src-5.11.3/qtbase/src/corelib/global/qrandom.cpp:455:62: error: no matching function for call to ‘std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(QRandomGenerator::SystemGenerator&)’
  455 |         new (&rng->storage.engine()) RandomEngine(self()->sys);
      |                                                              ^
In file included from /usr/include/c++/9/random:49,
                 from /home/ubuntu/Qtlinux/qt-everywhere-src-5.11.3/qtbase/src/corelib/global/qrandom.h:45,
                 from /home/ubuntu/Qtlinux/qt-everywhere-src-5.11.3/qtbase/src/corelib/global/qrandom.cpp:43:
/usr/include/c++/9/bits/random.h:530:9: note: candidate: ‘template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&)’
  530 |         mersenne_twister_engine(_Sseq& __q)
      |         ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/random.h:530:9: note:   template argument deduction/substitution failed:
/usr/include/c++/9/bits/random.h: In substitution of ‘template<class _Sseq, class _Engine, class _Res, class _GenerateCheck> using __is_seed_seq = std::__and_<std::__not_<std::is_same<typename std::remove_cv<typename std::remove_reference<_Tp>::type>::type, _Engine> >, std::is_unsigned<typename _Sseq::result_type>, std::__not_<std::is_convertible<_Sseq, _Res> > > [with _Sseq = QRandomGenerator::SystemGenerator; _Engine = std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>; _Res = unsigned int; _GenerateCheck = void]’:
/usr/include/c++/9/bits/random.h:491:8:   required by substitution of ‘template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using _If_seed_seq = typename std::enable_if<std::__detail::__is_seed_seq<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType>::value>::type [with _Sseq = QRandomGenerator::SystemGenerator; _UIntType = unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]’
/usr/include/c++/9/bits/random.h:528:32:   required from here
/usr/include/c++/9/bits/random.h:197:13: error: no type named ‘result_type’ in ‘struct QRandomGenerator::SystemGenerator’
  197 |       using __is_seed_seq = __and_<
      |             ^~~~~~~~~~~~~
/usr/include/c++/9/bits/random.h:519:7: note: candidate: ‘std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type) [with _UIntType = unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type = unsigned int]’
  519 |       mersenne_twister_engine(result_type __sd)
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/random.h:519:43: note:   no known conversion for argument 1 from ‘QRandomGenerator::SystemGenerator’ to ‘std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type’ {aka ‘unsigned int’}
  519 |       mersenne_twister_engine(result_type __sd)
      |                               ~~~~~~~~~~~~^~~~
/usr/include/c++/9/bits/random.h:516:7: note: candidate: ‘std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]’
  516 |       mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
      |       ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/random.h:516:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/9/bits/random.h:461:11: note: candidate: ‘constexpr std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)’
  461 |     class mersenne_twister_engine
      |           ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/random.h:461:11: note:   no known conversion for argument 1 from ‘QRandomGenerator::SystemGenerator’ to ‘const std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&’
/usr/include/c++/9/bits/random.h:461:11: note: candidate: ‘constexpr std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)’
/usr/include/c++/9/bits/random.h:461:11: note:   no known conversion for argument 1 from ‘QRandomGenerator::SystemGenerator’ to ‘std::mersenne_twister_engine<unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&’
make: *** [Makefile:314:qrandom.o] 错误 1
\033[1;33mdone...\033[0m
\033[1;33mstart make and install qt-everywhere-src-5.11.3 ...\033[0m
make: *** 没有指明目标并且找不到 makefile。 停止。
\033[1;33mdone...\033[0m
ubuntu@ubuntu:~/Qtlinux$ make -j4
make: *** 没有指明目标并且找不到 makefile。 停止。



回复

使用道具 举报

 楼主| 发表于 2021-5-28 11:35:26 | 显示全部楼层
我后来重新安装Ubuntu18.04,交叉编译成功啦,需要知道怎么搞得可以多交流,VX15980931131,备注Linux嵌入式交流
回复 支持 反对

使用道具 举报

发表于 2021-6-16 09:58:42 | 显示全部楼层
我也是这种情况,楼主这是因为什么,不重装Ubuntu能改成功么。
回复 支持 反对

使用道具 举报

发表于 2021-7-9 09:28:54 | 显示全部楼层
可能是路径上有中文
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-11-24 15:48 , Processed in 0.040252 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表