QT Arm Linux 面向搜索引擎编程 新手入门 问题一览
张静茹 2019-8-16Linux

ARM 4418 开发板 使用 Ubuntu Mate系统

apt-get update 无法更新 安装软件 挂代理无效


更改/etc/apt/sources.list 

## Note, this file is written by cloud-init on first boot of an instance 
## modifications made here will not survive a re-bundle. 
## if you wish to make changes you can: 
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg 
##     or do the same in user-data 
## b.) add sources in /etc/apt/sources.list.d 
## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to 
# newer versions of the distribution. 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial main restricted 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial main restricted


## Major bug fix updates produced after the final release of the 
## distribution. 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates main restricted 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates main restricted 

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team. Also, please note that software in universe WILL NOT receive any 
## review or updates from the Ubuntu security team. 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial universe 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial universe 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates universe 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates universe



## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu 
## security team. 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial multiverse 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-updates multiverse



## N.B. software from this repository may not have been tested as 
## extensively as that contained in the main release, although it includes 
## newer versions of some applications which may provide useful features. 
## Also, please note that software in backports WILL NOT receive any review 
## or updates from the Ubuntu security team. 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-backports main restricted universe multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-backports main restricted universe multiverse 

deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security main restricted 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security main restricted 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security universe 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security universe 
deb http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security multiverse 
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports xenial-security multiverse 

## Uncomment the following two lines to add software from Canonical's 
## 'partner' repository. 
## This software is not part of Ubuntu, but is offered by Canonical and the 
## respective vendors as a service to Ubuntu users. 
# deb http://archive.canonical.com/ubuntu xenial partner 
# deb-src http://archive.canonical.com/ubuntu xenial partner


[修改于 3 个月前 - 2019-08-31 17:00:33]

来自 Linux
2019-8-16 16:09:22
张静茹(作者)
1楼

visual studio Linux 开发

新建工程 linux c 工程

添加 远程shh

在开发板中安装 g++ 编译环境

apt install g++


至此vs 可以远程生成了


开始调试

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

Microsoft Visual Studio

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

无法启动 gdb。系统中缺少 gdb,需进行安装,请使用系统的包管理器进行安装。


apt install  gdb 



开始调试 产生

Segmentation fault 


项目->属性->配置类型->改为"应用程序"



shows "Loading symbols for module /lib/ld-linux-armhf.so.3" and never finishes loading 

解决方法:

Run "sudo apt-get install gdbserver" and change Debugging Mode to "gdbserver" in Visual Studio. You can find the Debugging Mode setting in Right Click on Project > Properties > Debugging

只需要 改Debugging Mode to "gdbserver 即可

https://stackoverflow.com/questions/48394945/remote-debugging-on-raspberry




至此 VS 可以正常调试了


image.png








[修改于 4 个月前 - 2019-08-16 16:59:45]

折叠评论
加载评论中,请稍候...
折叠评论
2019-08-21 14:34:47
2019-8-21 14:34:47
张静茹(作者)
2楼

image.png

VisualGDB 编译调试QT

折叠评论
加载评论中,请稍候...
折叠评论
2019-08-22 09:36:07
张静茹(作者)
3楼

 apt-get install qtbase5-dev qt5-default libqt5gui5 libqt5network5 libqt5printsupport5 libqt5widgets5 libqt5opengl5-dev libproxy1v5 libdevmapper1.02.1 watershed


arm开发板安装 qt开发环境


两个开发板的问题不一样,第二张3399开发板依然安装失败


最后好像是挂代理安装好的


只需要 apt-get install qtbase5-dev




2019-09-08 

apt-get install qtbase5-dev qt5-default libqt5gui5 libqt5network5 libqt5printsupport5 libqt5widgets5 libqt5opengl5-dev libproxy1v5 libdevmapper1.02.1 watershed  libgles2-mesa-dev libegl1-mesa-dev qtbase5-dev-tools update-inetd libmirclient-dev libmircommon-dev libprotobuf-dev libprotobuf9v5


apt-get install qtbase5-dev qt5-default libqt5gui5 libqt5network5 libqt5printsupport5 libqt5widgets5 libqt5opengl5-dev libproxy1v5 libdevmapper1.02.1 watershed libgles2-mesa-dev qtbase5-dev-tools libegl1-mesa-dev update-inetd libmirclient-dev libmircommon-dev libprotobuf-dev libprotobuf9v5


apt-get install qtbase5-dev qt5-default qtbase5-dev-tools libgles2-mesa-dev libqt5gui5 libqt5network5 libqt5printsupport5 libqt5widgets5 libqt5opengl5-dev libegl1-mesa-dev libproxy1v5 gvfs-daemons libmirclient-dev watershed update-inetd systemd xserver-xorg-video-fbdev libmircommon-dev libprotobuf-dev libprotobuf9v5

才安装成功


apt-get install qtbase5-dev 5.9 

可以指定版本




 又出现了 下面的问题

[修改于 12 天前 - 2019-11-28 09:06:06]

折叠评论
加载评论中,请稍候...
折叠评论
2019-08-24 18:37:02
2019-8-24 18:37:02
4楼

茄子nb

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
5楼

root@firefly:~# apt-get install gdb

Reading package lists... Done

Building dependency tree       

Reading state information... Done

You might want to run 'apt --fix-broken install' to correct these.

The following packages have unmet dependencies:

 gdb : Depends: libbabeltrace1 (>= 1.2.1) but it is not going to be installed

       Recommends: libc-dbg

       Recommends: gdbserver but it is not going to be installed

 libgl1-mesa-dev : Depends: mesa-common-dev (= 19.0.8-0ubuntu0~18.04.1) but 18.2.8-0ubuntu0~18.04.2 is to be installed

                   Depends: libglvnd-dev but it is not going to be installed

E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

root@firefly:~# apt --fix-broken install

Reading package lists... Done

Building dependency tree       

Reading state information... Done

Correcting dependencies... Done

The following additional packages will be installed:

  libglvnd-dev mesa-common-dev

The following NEW packages will be installed:

  libglvnd-dev

The following packages will be upgraded:

  mesa-common-dev

1 upgraded, 1 newly installed, 0 to remove and 191 not upgraded.

36 not fully installed or removed.

Need to get 0 B/606 kB of archives.

After this operation, 279 kB of additional disk space will be used.

Do you want to continue? [Y/n] Y

(Reading database ... 106038 files and directories currently installed.)

Preparing to unpack .../mesa-common-dev_19.0.8-0ubuntu0~18.04.1_arm64.deb ...

Unpacking mesa-common-dev:arm64 (19.0.8-0ubuntu0~18.04.1) over (18.2.8-0ubuntu0~18.04.2) ...

dpkg: error processing archive /var/cache/apt/archives/mesa-common-dev_19.0.8-0ubuntu0~18.04.1_arm64.deb (--unpack):

 trying to overwrite '/usr/include/KHR/khrplatform.h', which is also in package libmali-rk-dev:arm64 1.6-1

dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

Preparing to unpack .../libglvnd-dev_1.0.0-2ubuntu2.3_arm64.deb ...

Unpacking libglvnd-dev:arm64 (1.0.0-2ubuntu2.3) ...

dpkg: error processing archive /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.3_arm64.deb (--unpack):

 trying to overwrite '/usr/lib/aarch64-linux-gnu/libEGL.so', which is also in package rockchip-mali-midgard14 1.6-1

Errors were encountered while processing:

 /var/cache/apt/archives/mesa-common-dev_19.0.8-0ubuntu0~18.04.1_arm64.deb

 /var/cache/apt/archives/libglvnd-dev_1.0.0-2ubuntu2.3_arm64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

root@firefly:~# 





dpkg: error processing archive /var/cache/apt/archives/mesa-common-dev_19.0.8-0ubuntu0~18.04.1_arm64.deb (--unpack):

 trying to overwrite '/usr/include/KHR/khrplatform.h', which is also in package libmali-rk-dev:arm64 1.6-1

dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

You might want to run 'apt --fix-broken install' to correct these.

解决方法 

删除 /var/lib/dpkg/info 内的所有文件 重新执行apt --fix-broken install

折叠评论
加载评论中,请稍候...
折叠评论
2019-08-25 13:06:35
张静茹(作者)
6楼

VisualGDB 创建的Qt工程 好像默认不支持Qml QT Quike

QQmlApplicationEngine 头文件找不到

Arm Linux 中找不到这个头文件


编辑D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.pro

QT       += core gui 

改为 

QT       += quick

报错 Unknown module(s) in QT: quick


解决方法

https://blog.csdn.net/hhhlizhao/article/details/73604445

apt-get install qtdeclarative5-dev

https://packages.debian.org/buster/qtdeclarative5-dev

https://packages.debian.org/buster/libqt5qml5

[修改于 3 个月前 - 2019-08-25 13:50:48]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
7楼

undefined reference to `QQmlApplicationEngine::QQmlApplicationEngine(QObject*)' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 10

undefined reference to `QQmlApplicationEngine::objectCreated(QObject*, QUrl const&)' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 12

undefined reference to `QQmlApplicationEngine::objectCreated(QObject*, QUrl const&)' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 12

undefined reference to `QQmlApplicationEngine::load(QUrl const&)' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 20

undefined reference to `QQmlApplicationEngine::~QQmlApplicationEngine()' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 10

undefined reference to `QQmlApplicationEngine::~QQmlApplicationEngine()' LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\LinuxProject1.cpp 10

undefined reference to `QQmlApplicationEngine::staticMetaObject' LinuxProject1 C:\Users\Game\AppData\Local\VisualGDB\RemoteSourceCache\192.168.1.104\0000\include\aarch64-linux-gnu\qt5\QtCore\qobject.h 339

undefined reference to `QQmlApplicationEngine::staticMetaObject' LinuxProject1 C:\Users\Game\AppData\Local\VisualGDB\RemoteSourceCache\192.168.1.104\0000\include\aarch64-linux-gnu\qt5\QtCore\qobject.h 339

ld returned 1 exit status LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\collect2 1

Command-line action failed LinuxProject1 D:\Project\QT\LinuxProject1\LinuxProject1\VisualGDB 1




原因 没有在pro文件指定 QT+=quick 找不到 lib 文件 

[修改于 3 个月前 - 2019-08-30 09:11:18]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
8楼

root@firefly:/tmp/VisualGDB/d/Project/QT/LinuxProject1/LinuxProject1/Debug# ./LinuxProject1 

QQmlApplicationEngine failed to load component

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed

qrc:/main.qml:1 module "QtQuick" is not installed

qrc:/main.qml:2 module "QtQuick.Window" is not installed



https://askubuntu.com/questions/322356/qtquick-not-found-lubuntu

apt-get qtdeclarative5-qtquick2-plugin





[修改于 3 个月前 - 2019-08-25 23:29:02]

折叠评论
加载评论中,请稍候...
折叠评论
2019-08-31 16:59:31
2019-8-31 16:59:31
张静茹(作者)
9楼

variable `xxx' has initializer but incomplete type

出现这个错误字面意思是变量xxx定义了,但是不完整,

解决方法是,没有找到xxx变量的头文件,包含头文件即可解决

https://blog.csdn.net/weixin_42445727/article/details/82594215

折叠评论
加载评论中,请稍候...
折叠评论
2019-09-01 16:07:28
张静茹(作者)
10楼

//Using QQmlComponent

//QQmlEngine engine;

//QQmlComponent component(&engine,

// QUrl::fromLocalFile("main.qml"));

//QObject *object = component.create();

// delete object;

//qml 根对象 Window



QQuickView view(QUrl::fromLocalFile("main.qml"));

view.show();

QObject *object = view.rootObject();

//object = view.rootContext();

//qml 根对象 Rectangle 或 Item


       //auto test_txt1 = object->findChild<QObject*>("test_text1");

//test_txt1->setProperty("text", "00000000");



 object->findChild<QObject*>("test_text1"); 返回null

解决方法 qml 中的 控件名要使用 objectName 而不是 id 

Text {

        objectName:"test_text1" // 注意 必须使用 ""

        id: element

        x: 292

        y: 271

        text: qsTr("Text")

        font.pixelSize: 28

    }






折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
11楼

QQuickView view(QUrl::fromLocalFile("main.qml"));

view.show();

QObject *object = view.rootObject();




 view.rootObject(); 返回null

QQuickView qml 根对象 Rectangle 或 Item

折叠评论
加载评论中,请稍候...
折叠评论
2019-09-10 10:42:30
2019-9-10 10:42:30
张静茹(作者)
12楼

使用sd卡的 开发板 烧写镜像后 系统剩余空间 16G的sd卡仅有几百兆 剩余空间

使用 fdisk /dev/mmcblk0 为sd卡 重新分区


root@Ubuntu-mate:~#  fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.


Command (m for help): p

Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x00098996


Device         Boot  Start      End  Sectors  Size Id Type

/dev/mmcblk0p1        2048   133119   131072   64M 83 Linux

/dev/mmcblk0p2      133120 30000000 29866881 14.2G 83 Linux


输入d 2 删除第二个分区

输入n p 新建主分区 注意 要留个几百兆不要使用 sd卡可能会损坏 做镜像烧新卡的话镜像太慢 有可能 新卡写不进去

输入分区大小

w存盘 reboot重启

启动后 resize2fs  /dev/mmcblk0p2

reboot 再重启一下


df -h 查看磁盘剩余


[修改于 10 天前 - 2019-11-30 22:48:28]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
13楼

这楼的 方法是错误的 删掉了

[修改于 3 个月前 - 2019-09-13 20:34:23]

折叠评论
加载评论中,请稍候...
折叠评论
2019-09-11 13:28:12
张静茹(作者)
14楼

需要安装的软件一览

gdb g++ make proxychina 

折叠评论
加载评论中,请稍候...
折叠评论
2019-09-13 15:23:44
2019-9-13 15:23:44
张静茹(作者)
15楼

> main.cpp:8:19: fatal error: variant: No such file or directory

> compilation terminated.

> Makefile:167: recipe for target 'main.o' failed

> make: *** [main.o] Error 1


安装g ++ - 7; 例如,如果ubuntu

sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y 

sudo apt-get update 

sudo apt-get install g++-7




add-apt-repository: command not found

解决方法

apt-get install software-properties-common python-software-properties



折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
16楼

qt 源码 build 方法

./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -release -opensource -make libs -xplatform linux-g++-32 -optimized-qmake -pch -qt-libjpeg -qt-zlib -no-opengl -skip qt3d -skip qtcanvas3d -skip qtpurchasing -no-sse2 -no-openssl -no-cups -no-glib -no-iconv -nomake examples -nomake tools -skip qtvirtualkeyboard


实际测试:

./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -opensource -no-opengl 

qpaintervideosurface.cpp:67:12: error: invalid use of incomplete type 'class QGLContext'

     context->makeCurrent();




./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -release -opensource -platform linux-g++ -make libs -optimized-qmake -pch -qt-libjpeg -qt-zlib -skip qt3d -skip qtcanvas3d -skip qtpurchasing -no-sse2 -no-openssl -no-cups -no-glib -no-iconv -nomake examples -nomake tools -skip qtvirtualkeyboard

去掉 -opengl 指定 -platform linux-g++



./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -release -opensource -platform linux-g++ 



./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -release -opensource -platform linux-g++ 

 -nomake docs -nomake examples -nomake demos -nomake tests


./configure -prefix /usr/local/Trolltech/Qt-5.12.4-arm/ -release -opensource -platform linux-g++ -nomake examples -nomake tests


交叉编译使用linux-arm-gnueabi-g++ 

make clean 清除编译


debian x86 安装 交叉编译器 apt-get install g++-arm-linux-gnueabihf

config 使用 平台 linux-arm-gnueabihf-g++ 

在 qtbase/mkspecs 中新建 linux-arm-gnueabihf-g++  编辑 qmake.conf 全部编译器改为 linux-arm-gnueabi-g++


查看文件格式 

file sqlite3-shell.o

sqlite3-shell.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped




 The OpenGL functionality tests failed!

解决方法 apt-get install libgl1-mesa-dev libglu1-mesa-dev 

注意 安装完以后 删除全部qt源码重新解压 后 错误才会消失





[修改于 2 个月前 - 2019-10-10 10:38:17]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
17楼
在编译Qt程序时出现如下报错
Qt error: one or more PCH files were found, but they were invalid

这是因为之前编译过程序,留下一些配置文件导致无法编译,清除之前的编译残留就行了
make distclean


折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
18楼

qt 编译安卓的时候  产生

Command does not exist: C:\Microsoft\AndroidNDK64\android-ndk-r16b/toolchains/llvm/prebuilt/windows-x86_64/bin/llvm-strip.exe


更新 ndk 版本就好了

android-ndk-r16b 更新到 android-ndk-r20

折叠评论
加载评论中,请稍候...
折叠评论
2019-09-18 19:13:39
2019-9-18 19:13:39
张静茹(作者)
19楼

linux 挂载移动硬盘

自动挂载到了 /media/fa/新加卷/


cd 不进去中文路径


fdisk -l 查看磁盘设备名




执行 umount /dev/sda1 卸载

mkdir /mnt/usb

mount -t /dev/sda1 /mnt/usb




[修改于 3 个月前 - 2019-09-18 22:02:07]

折叠评论
加载评论中,请稍候...
折叠评论
2019-10-11 11:09:15
2019-10-11 11:09:15
张静茹(作者)
20楼
折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
21楼

Linux下C语言生成可执行文件的过程

在当前目录下创建一个C源文件并打开:

touch test.c
gedit test.c
直接编译:
 gcc test.c -o test

 

分步骤编译:

1) 预处理
    gcc -E test.c -o test.i
在当前目录下会多出一个预处理结果文件 test.i,打开 test.i 可以看到,在 test.c 的基础上把stdio.h和stdlib.h的内容插进去了。

2) 编译为汇编代码
    gcc -S test.i -o test.s
其中-S参数是在编译完成后退出,-o为指定文件名。

3) 汇编为目标文件
    gcc -c test.s -o test.o
.o就是目标文件。目标文件与可执行文件类似,都是机器能够识别的可执行代码,但是由于还没有链接,结构会稍有不同。

3) 链接并生成可执行文件
    gcc test.o -o test



readelf -h filename

查看可执行文件 elf 格式 arm x86 x64 等

[修改于 2 个月前 - 2019-10-11 14:49:49]

折叠评论
加载评论中,请稍候...
折叠评论
2019-10-14 14:44:50
2019-10-14 14:44:50
张静茹(作者)
22楼

linux 挂载 img 文件

fdisk xxx.img

p

记录你想挂在的分区的start*512


mkdir /mnt/xxxx

mount -o loop,offset=start*512 xxx.img /mnt/xxxx


卸载 umount /mnt/xxxx


fuser -cu /mnt/xxxx

fuser -ck /mnt/xxxx

如果出现目标忙无法卸载

需要杀死占用的进程 卸载


NTFS U盘可能需要

fdisk -l 找到/dev/sd*


 mount -t ntfs /dev/sdb1 /mnt/sdb1

 mount /dev/sdb1 /mnt/sdb1


[修改于 1 个月前 - 2019-10-28 09:26:12]

折叠评论
加载评论中,请稍候...
折叠评论
2019-10-18 11:58:58
2019-10-18 11:58:58
张静茹(作者)
23楼

\etc\ld.so.conf

/opt/Qt5.12.4_ARM_Linux/lib


修改 so文件搜索路径后要 ldconfig 刷新

添加 QT lib路径


link /opt/Qt5.12.4_ARM_Linux/lib 中的so文件到 /lib/ 下


ldd 查看 so 和 可执行文件 依赖

ll 软连接



 strings libc.so.6 |grep GLIBC_

搜索libc.so.6文件中 所有包含GLIBC_ 的 string 

[修改于 2 个月前 - 2019-10-19 23:37:19]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
24楼

 ldd libQt5Core.so.5

./libQt5Core.so.5: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.25' not found (required by ./libQt5Core.so.5)

        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76af3000)

        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76ae0000)

        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x769d2000)

        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7695a000)

        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76932000)

        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76845000)

        /lib/ld-linux-armhf.so.3 (0x76fcd000)



 ldd libQt5Core.so.5 提示 libc.so.6: version `GLIBC_2.25' not found 

strings /lib64/libc.so.6|grep GLIBC 查看 现在支持的版本

GLIBC_2.2.5

.........

GLIBC_2.15

GLIBC_2.16

GLIBC_2.17

GLIBC_PRIVATE




解决方法

http://ftp.gnu.org/pub/gnu/glibc/ 下载最新版本GLIBC


sudo apt-get install gawk

apt-get install bison


1. tar -xvf  glibc-2.18.tar.gz    解压


4. cd glibc-2.18


5. mkdir build;  


6.  cd build


7. ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include


8. make -j4


9. make install  





实测无用 装完了 系统崩了


[修改于 2 个月前 - 2019-10-22 15:01:02]

折叠评论
加载评论中,请稍候...
折叠评论
2019-10-22 14:58:49
2019-10-22 14:58:49
张静茹(作者)
25楼

错误libGLESv2.so.2:无法打开共享库文件:没有这样的文件或目录 #183

安装libgles2-mesa libgles2-mesa-dev 




Video Acceleration Information (at the end)

Log Messages
[20744: 20744: 0505 / 151840.397379: ERROR: gl_implementation.cc (292)]: Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: /usr/lib/chromium/swiftshader/libGLESv2.so: Can not open the shared object file: No file or folder of this type
GpuProcessHostUIShim: The GPU process exited with code 1024.

Solution:

find lib with:
ldconfig -p | grep libGLESv2

libGLESv2.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLESv2.so.2
libGLESv2.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libGLESv2.so

or with:
locate libGLESv2

/usr/lib/x86_64-linux-gnu/libGLESv2.so.2
/usr/lib/x86_64-linux-gnu/libGLESv2.so.2.0.0
/usr/lib/x86_64-linux-gnu/opera/libGLESv2.so
/usr/lib/x86_64-linux-gnu/opera/swiftshader/libGLESv2.so

Verification of the presence of the swiftshader folder
ls /usr/lib/chromium

(if the swiftshader folder does not exist)

sudo mkdir /usr/lib/chromium/swiftshader

then

sudo ln -s /usr/lib/x86_64-linux-gnu/libGLESv2.so /usr/lib/chromium/swiftshader/libGLESv2.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libEGL.so /usr/lib/chromium/swiftshader/libEGL.so

finally

chrome://restart



折叠评论
加载评论中,请稍候...
折叠评论
2019-11-06 21:46:07
2019-11-6 21:46:07
张静茹(作者)
26楼

对比 4418 和 3399 apt 搜索qt 列表给phantom 

确定开发板子是否支持 opengl

[修改于 1 个月前 - 2019-11-06 21:46:49]

折叠评论
加载评论中,请稍候...
折叠评论
2019-11-08 09:07:28
2019-11-8 09:07:28
张静茹(作者)
27楼
#!/bin/bash
# 获取要监控的本地服务器IP地址
IP=`ifconfig | grep inet | grep -vE 'inet6|127.0.0.1' | awk '{print $2}'`
echo "IP地址:"$IP
 
# 获取cpu总核数
cpu_num=`grep -c "model name" /proc/cpuinfo`
echo "cpu总核数:"$cpu_num
 
# 1、获取CPU利用率
################################################
#us 用户空间占用CPU百分比
#sy 内核空间占用CPU百分比
#ni 用户进程空间内改变过优先级的进程占用CPU百分比
#id 空闲CPU百分比
#wa 等待输入输出的CPU时间百分比
#hi 硬件中断
#si 软件中断
#################################################
# 获取用户空间占用CPU百分比
cpu_user=`top -b -n 1 | grep Cpu | awk '{print $2}' | cut -f 1 -d "%"`
echo "用户空间占用CPU百分比:"$cpu_user
 
# 获取内核空间占用CPU百分比
cpu_system=`top -b -n 1 | grep Cpu | awk '{print $4}' | cut -f 1 -d "%"`
echo "内核空间占用CPU百分比:"$cpu_system
 
# 获取空闲CPU百分比
cpu_idle=`top -b -n 1 | grep Cpu | awk '{print $8}' | cut -f 1 -d "%"`
echo "空闲CPU百分比:"$cpu_idle
 
# 获取等待输入输出占CPU百分比
cpu_iowait=`top -b -n 1 | grep Cpu | awk '{print $10}' | cut -f 1 -d "%"`
echo "等待输入输出占CPU百分比:"$cpu_iowait
 
#2、获取CPU上下文切换和中断次数
# 获取CPU中断次数
cpu_interrupt=`vmstat -n 1 1 | sed -n 3p | awk '{print $11}'`
echo "CPU中断次数:"$cpu_interrupt
 
# 获取CPU上下文切换次数
cpu_context_switch=`vmstat -n 1 1 | sed -n 3p | awk '{print $12}'`
echo "CPU上下文切换次数:"$cpu_context_switch
 
#3、获取CPU负载信息
# 获取CPU15分钟前到现在的负载平均值
cpu_load_15min=`uptime | awk '{print $11}' | cut -f 1 -d ','`
echo "CPU 15分钟前到现在的负载平均值:"$cpu_load_15min
 
# 获取CPU5分钟前到现在的负载平均值
cpu_load_5min=`uptime | awk '{print $10}' | cut -f 1 -d ','`
echo "CPU 5分钟前到现在的负载平均值:"$cpu_load_5min
 
# 获取CPU1分钟前到现在的负载平均值
cpu_load_1min=`uptime | awk '{print $9}' | cut -f 1 -d ','`
echo "CPU 1分钟前到现在的负载平均值:"$cpu_load_1min
 
# 获取任务队列(就绪状态等待的进程数)
cpu_task_length=`vmstat -n 1 1 | sed -n 3p | awk '{print $1}'`
echo "CPU任务队列长度:"$cpu_task_length
 
#4、获取内存信息
# 获取物理内存总量
mem_total=`free | grep Mem | awk '{print $2}'`
echo "物理内存总量:"$mem_total
 
# 获取操作系统已使用内存总量
mem_sys_used=`free | grep Mem | awk '{print $3}'`
echo "已使用内存总量(操作系统):"$mem_sys_used
 
# 获取操作系统未使用内存总量
mem_sys_free=`free | grep Mem | awk '{print $4}'`
echo "剩余内存总量(操作系统):"$mem_sys_free
 
# 获取应用程序已使用的内存总量
mem_user_used=`free | sed -n 3p | awk '{print $3}'`
echo "已使用内存总量(应用程序):"$mem_user_used
 
# 获取应用程序未使用内存总量
mem_user_free=`free | sed -n 3p | awk '{print $4}'`
echo "剩余内存总量(应用程序):"$mem_user_free
 
 
# 获取交换分区总大小
mem_swap_total=`free | grep Swap | awk '{print $2}'`
echo "交换分区总大小:"$mem_swap_total
 
# 获取已使用交换分区大小
mem_swap_used=`free | grep Swap | awk '{print $3}'`
echo "已使用交换分区大小:"$mem_swap_used
 
# 获取剩余交换分区大小
mem_swap_free=`free | grep Swap | awk '{print $4}'`
echo "剩余交换分区大小:"$mem_swap_free
 
#5、获取磁盘I/O统计信息
echo "指定设备(/dev/sda)的统计信息"
# 每秒向设备发起的读请求次数
disk_sda_rs=`iostat -kx | grep sda| awk '{print $4}'`
echo "每秒向设备发起的读请求次数:"$disk_sda_rs
 
# 每秒向设备发起的写请求次数
disk_sda_ws=`iostat -kx | grep sda| awk '{print $5}'`
echo "每秒向设备发起的写请求次数:"$disk_sda_ws
 
# 向设备发起的I/O请求队列长度平均值
disk_sda_avgqu_sz=`iostat -kx | grep sda| awk '{print $9}'`
echo "向设备发起的I/O请求队列长度平均值"$disk_sda_avgqu_sz
 
# 每次向设备发起的I/O请求平均时间
disk_sda_await=`iostat -kx | grep sda| awk '{print $10}'`
echo "每次向设备发起的I/O请求平均时间:"$disk_sda_await
 
# 向设备发起的I/O服务时间均值
disk_sda_svctm=`iostat -kx | grep sda| awk '{print $11}'`
echo "向设备发起的I/O服务时间均值:"$disk_sda_svctm
 
# 向设备发起I/O请求的CPU时间百分占比
disk_sda_util=`iostat -kx | grep sda| awk '{print $12}'`
echo "向设备发起I/O请求的CPU时间百分占比:"$disk_sda_util


折叠评论
加载评论中,请稍候...
折叠评论
2019-11-29 15:21:07
2019-11-29 15:21:07
张静茹(作者)
28楼

3288 linux 系统 qt app依赖 与so路径 库位置

root@firefly:/opt/armapp# ldd armapp

./armapp: /usr/lib/arm-linux-gnueabihf/libQt5Qml.so.5: version `Qt_5' not found (required by ./armapp)

./armapp: /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5: version `Qt_5' not found (required by ./armapp)

./armapp: /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5: version `Qt_5' not found (required by ./armapp)

        linux-vdso.so.1 =>  (0xbec90000)

        libQt5Quick.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Quick.so.5 (0xb6d9d000)

        libQt5Gui.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 (0xb6ab6000)

        libQt5Qml.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Qml.so.5 (0xb6829000)

        libQt5Network.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Network.so.5 (0xb674c000)

        libQt5Core.so.5 => /usr/lib/arm-linux-gnueabihf/libQt5Core.so.5 (0xb6404000)

        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb63e0000)

        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb62d1000)

        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6259000)

        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6231000)

        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6145000)

        libGLESv2.so.2 => /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2 (0xb4e1f000)

        /lib/ld-linux-armhf.so.3 (0x7f61a000)

        libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0xb4df6000)

        libharfbuzz.so.0 => /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0xb4da7000)

        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0xb4d85000)

        libdouble-conversion.so.1 => /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0xb4d67000)

        libproxy.so.1 => /usr/lib/arm-linux-gnueabihf/libproxy.so.1 (0xb4d43000)

        libicui18n.so.55 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.55 (0xb4ba9000)

        libicuuc.so.55 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.55 (0xb4a8c000)

        libpcre16.so.3 => /usr/lib/arm-linux-gnueabihf/libpcre16.so.3 (0xb4a36000)

        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb4a23000)

        libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb494b000)

        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb4934000)

        libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0xb4919000)

        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0xb4828000)

        libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0xb4816000)

        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0xb47f2000)

        libxcb-dri2.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri2.so.0 (0xb47dd000)

        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0xb4766000)

        libgraphite2.so.3 => /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0xb4740000)

        libicudata.so.55 => /usr/lib/arm-linux-gnueabihf/libicudata.so.55 (0xb2e79000)

        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb2e1b000)

        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0xb2e10000)

        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0xb2dfc000)


 echo $LD_LIBRARY_PATH 为空

/etc/ld.so.conf

include /etc/ld.so.conf.d/*.conf


[修改于 11 天前 - 2019-11-29 15:25:34]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
29楼

linux 设置so搜索路径


方法一:在配置文件/etc/ld.so.conf中指定动态库搜索路径。
vi /etc/ld.so.conf
添加 lib目录
ldconfig
方法二:通过环境变量LD_LIBRARY_PATH指定动态库搜索路径。
export LD_LIBRARY_PATH=”LD_LIBRARY_PATH:/opt/”
方法三:在编译目标代码时指定该程序的动态库搜索路径。
还可以在编译目标代码时指定程序的动态库搜索路径。通过gcc 的参数”-Wl,-rpath,”指定

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
30楼

https://blog.csdn.net/toradexsh/article/details/80842002

https://github.com/simonqin09/QtQMLMultimedia/blob/master/main.qml

https://github.com/simonqin09/QtQMLMultimedia/blob/master/main.cpp


#include <QGuiApplication>    
#include <QQmlApplicationEngine>    
#include <QtCore/QString>    
#include <QtCore/QStringList>    
#include <QtQml/QQmlContext>    
#include <QtCore/QDebug>    
int main(int argc, char *argv[])    
{    
QGuiApplication app(argc, argv);    
//get video/audio source URL from application "-url file:///home/root..." argument    
QUrl source;    
QStringList args = app.arguments();    
bool sourceIsUrl = false;    
for (int i = 1; i < args.size(); ++i) {    
const QByteArray arg = args.at(i).toUtf8();    
if (arg.startsWith('-')) {    
if ("-url" == arg) {    
sourceIsUrl = true;    
} else {    
qDebug() << "Option" << arg << "ignored";    
}    
} else {    
if ((sourceIsUrl == true) && arg.startsWith("file:///") )    
source = arg;    
else    
qDebug() << "Argument ignored! Please use \"-url file:///home/root/...\"";    
}    
}    
qDebug() << source;    
/*    
    QUrl url;    
    if (sourceIsUrl) {    
        url = source;    
    }    
    qDebug() << url; */    
QQmlApplicationEngine engine;    
engine.rootContext()->setContextProperty("mysource", source);    
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));    
return app.exec();    
}
import QtQuick 2.7    
import QtQuick.Window 2.2    
import QtMultimedia 5.0    
Window {    
visible: true    
id: root    
width: 1024    
height: 768    
title: qsTr("videotest")    
color: "transparent"    
/* property to control camera mode page load */    
property bool camera_mode_visible: false    
/* loader to load video mode page Component*/    
Loader{    
id: mainloader    
anchors.fill: parent    
z: 1    
}    
/* function load the page when mail qml is loaded */    
function loadpage(){    
mainloader.sourceComponent = maincomponent;    
}    
/* show the page when the qml file is loaded */    
Component.onCompleted: loadpage()    
/* Component for video mode page */    
Component {    
id: maincomponent    
Rectangle{    
visible: true    
id: rectangle_maincomponent    
width: 1024    
height: 768    
color: "#ffffff"    
/* CameraMode qml instance */    
CameraMode {    
id: cameramode1    
anchors.fill: parent    
z: 1    
}    
/* loader for load CameraMode.qml page */    
Loader{    
id: cameramodeloader    
anchors.fill: parent    
z: 1    
}    
/* media player box */    
Rectangle {    
id: rectangle    
x: 25    
y: 25    
width: 640    
height: 480    
color: "#000000"    
radius: 0    
MediaPlayer {    
id: player    
source: mysource    
}    
VideoOutput {    
anchors.fill: parent    
source: player    
}    
Component.onCompleted: {    
//console.log("yoursource is " + mysource);    
}    
}    
/* title bar for "Video Player" */    
Rectangle {    
id: rectangle_videooutput    
x: 666    
y: 25    
width: 358    
height: 30    
color: "#000000"    
radius: 2    
border.width: 0    
Text {    
id: text_videooutput    
anchors.centerIn: parent    
text: qsTr("Videoplayer")    
color: "white"    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 16    
}    
}    
/* "File Path" text box */    
Rectangle {    
id: rectangle_filepath    
x: 671    
y: 65    
width: 60    
height: 30    
color: "#000000"    
radius: 2    
border.width: 1    
Text {    
id: text_filepath    
anchors.centerIn: parent    
text: qsTr("File Path")    
color: "white"    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
}    
/* video file path box */    
Rectangle {    
id: rectangle_fileurl    
x: 671    
y: 100    
width: 341    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_fileurl    
text: mysource    
anchors.centerIn: parent    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
}    
/* Play button */    
Rectangle {    
id: rectangle_play    
x: 671    
y: 162    
width: 60    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_play    
anchors.centerIn: parent    
text: qsTr("Play")    
font.bold: true    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
/*    
                player.playbackState   0 mains stop status;    
                player.playbackState   1 mains playing status;    
                player.playbackState   2 mains pause status;    
                */    
MouseArea {    
anchors.fill: parent    
onClicked: {    
if (player.playbackState != 1){    
player.play();    
parent.color = "yellow";    
rectangle_pause.color = "#ffffff"    
rectangle_stop.color = "#ffffff"    
}    
}    
}    
}    
/* Pause button */    
Rectangle {    
id: rectangle_pause    
x: 751    
y: 162    
width: 60    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_pause    
anchors.centerIn: parent    
text: qsTr("Pause")    
font.bold: true    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
MouseArea {    
anchors.fill: parent    
onClicked: {    
if (player.playbackState == 1){    
player.pause();    
parent.color = "yellow";    
rectangle_play.color = "#ffffff"    
}    
}    
}    
}    
/* stop button */    
Rectangle {    
id: rectangle_stop    
x: 831    
y: 162    
width: 60    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_stop    
anchors.centerIn: parent    
text: qsTr("Stop")    
font.bold: true    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
MouseArea {    
anchors.fill: parent    
onClicked: {    
if (player.playbackState != 0){    
player.stop();    
parent.color = "yellow";    
rectangle_play.color = "#ffffff"    
rectangle_pause.color = "#ffffff"    
}    
}    
}    
}    
/* "Volume" text bar */    
Rectangle {    
id: rectangle_volume    
x: 671    
y: 212    
width: 60    
height: 30    
color: "#000000"    
radius: 2    
border.width: 1    
Text {    
id: text_volume    
anchors.centerIn: parent    
text: qsTr("Volume")    
font.bold: true    
color: "white"    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
}    
/* show current volume box */    
Rectangle {    
id: rectangle_currentvolume    
x: 791    
y: 212    
width: 80    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_currentvolume    
anchors.centerIn: parent    
text: player.volume    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
}    
/* add volume button */    
Rectangle {    
id: rectangle_add    
x: 751    
y: 212    
width: 30    
height: 30    
color: "#ffffff"    
radius: 1    
border.width: 1    
Text {    
id: text_add    
anchors.centerIn: parent    
text: qsTr("+")    
font.bold: true    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
MouseArea {    
anchors.fill: parent    
onPressed: {    
parent.color = "yellow";    
if(player.volume < 1){    
player.volume += 0.1;    
}    
}    
onReleased: {    
parent.color = "#ffffff"    
}    
}    
}    
/* volume minus button */    
Rectangle {    
id: rectangle_minus    
x: 881    
y: 212    
width: 30    
height: 30    
color: "#ffffff"    
radius: 1    
border.width: 1    
Text {    
id: text_minus    
anchors.centerIn: parent    
text: qsTr("-")    
font.bold: true    
verticalAlignment: Text.AlignVCenter    
horizontalAlignment: Text.AlignHCenter    
z: 1    
font.pixelSize: 12    
}    
MouseArea {    
anchors.fill: parent    
onPressed: {    
parent.color = "yellow";    
if(player.volume > 0){    
player.volume -= 0.1;    
}    
}    
onReleased: {    
parent.color = "#ffffff"    
}    
}    
}    
Connections {    
target: player    
onStopped: {    
// player status is MediaPlayer.EndOfMedia (6)    
if(player.status === MediaPlayer.EndOfMedia)    
{    
rectangle_play.color = "#ffffff"    
}    
}    
}    
/* button to switch to camera mode page */    
Rectangle {    
id: rectangle_switchtocamera    
x: 671    
y: 310    
width: 240    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_switchtocamera    
text: qsTr("Switch to Camera Mode")    
anchors.centerIn: parent    
font.bold: true    
horizontalAlignment: Text.AlignHCenter    
verticalAlignment: Text.AlignVCenter    
font.pixelSize: 12    
z: 1    
}    
MouseArea {    
anchors.fill: parent    
onPressed: {    
parent.color = "yellow";    
}    
onReleased: {    
parent.color = "#ffffff";    
camera_mode_visible = true;    
if (player.playbackState == 1){    
player.pause();    
rectangle_pause.color = "yellow";    
rectangle_play.color = "#ffffff"    
}    
cameramodeloader.source = "CameraMode.qml"    
}    
}    
}    
/* button to quit application */    
Rectangle {    
id: rectangle_quit    
x: 923    
y: 310    
width: 89    
height: 30    
color: "#ffffff"    
radius: 2    
border.width: 1    
Text {    
id: text_quit    
text: qsTr("Quit")    
anchors.centerIn: parent    
font.bold: true    
horizontalAlignment: Text.AlignHCenter    
verticalAlignment: Text.AlignVCenter    
font.pixelSize: 12    
z: 1    
}    
MouseArea {    
anchors.fill: parent    
onPressed: {    
parent.color = "yellow";    
}    
onReleased: {    
parent.color = "#ffffff";    
Qt.quit();    
}    
}    
}    
}    
}    
}


折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
31楼

https://www.jianshu.com/p/9cc782436ece

QT移植


#!/bin/sh

##qt5.9.1-arm
export QT_ROOT=/opt/qt5.9.1-arm
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:$QT_ROOT/lib
export QT_QPA_PLATFORM_PLUGIN_PATH=$QT_ROOT/plugins
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_FONTDIR=$QT_ROOT/lib/fonts
export QML2_IMPORT_PATH=$QT_ROOT/qml
export QT_QPA_PLATFORM=eglfs
export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=2
export QT_QPA_EGLFS_PHYSICAL_WIDTH=698             #根据你的显示器设置宽度,单位mm
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=392           #根据你的显示器设置高度,单位mm

https://blog.csdn.net/x356982611/article/details/71036775


设置环境变量

在~/.bashrc 中添加以下

export QTDIR=/usr
export QT_QPA_FONTDIR=$QTDIR/lib/fonts
export QT_QPA_PLATFORM_PLUGIN_PATH=$QTDIR/plugins/
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export QML_IMPORT_PATH=
export QML2_IMPORT_PATH=$QTDIR/qml
export QT_QPA_PLATFORM=linuxfb:fb=/dev/fb0:size=800x600:mmSize=800x600:offset=0x0:tty=/dev/tty1

#export QT_QPA_EGLFS_FB="/dev/fb0"
#export QT_QPA_EGLFS_WIDTH=800
#export QT_QPA_EGLFS_HEIGHT=600
#export QT_QPA_EGLFS_DEPTH=32
#export QT_QPA_EGLFS_PHYSICAL_WIDTH=1920
#export QT_QPA_EGLFS_PHYSICAL_HEIGHT=1080



更新环境变量

souce ~/.bashrc


说明

在嵌入式Linux系统上有多个可以使用的平台插件:EGLFS,LinuxFB,KMS,DirectFB,Wayland。 这些可用性取决于Qt的配置。 在许多板上选择eglfs作为默认选项。 如果默认值不合适,则可以使用QT_QPA_PLATFORM环境变量参数来调用另一个插件。 或者可以使用” ./app.out -platfrom linuxfb “命令行。


参考

http://wiki.qt.io/QtWayland

http://doc.qt.io/qt-5/embedded-linux.html



[修改于 11 天前 - 2019-11-29 23:35:43]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
32楼

apt-get install qml-module-qtquick-controls 



Setting up qml-module-qtquick-layouts:armhf (5.9.5-0ubuntu1.1) ...

Setting up qml-module-qtquick-window2:armhf (5.9.5-0ubuntu1.1) ...

Setting up qml-module-qtgraphicaleffects:armhf (5.9.5-0ubuntu1) ...

Setting up qml-module-qtquick-controls:armhf (5.9.5-0ubuntu1) ...




QQmlApplicationEngine failed to load component

qrc:/main.qml:2 module "QtQuick.Window" is not installed


折叠评论
加载评论中,请稍候...
折叠评论
2019-11-30 00:38:56
张静茹(作者)
33楼

 apt-get install libicu-dev

注意 glibc被升级了


https://stackoverflow.com/questions/35840359/libicuuc-so-55-cannot-open-shared-object-file


 ./armapp: error while loading shared libraries: libicui18n.so.55: cannot open shared object file: No such file or directory


 ./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Quick.so.5)
./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Gui.so.5)
./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Qml.so.5)
./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Network.so.5)
./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Core.so.5)
./armapp: /usr/lib/arm-linux-gnueabihf/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /opt/Qt5.12.4_ARM_Linux/lib/libQt5Core.so.5)
        libQt5Quick.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Quick.so.5 (0x76c2d000)
        libQt5Gui.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Gui.so.5 (0x76844000)
        libQt5Qml.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Qml.so.5 (0x76544000)
        libQt5Network.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Network.so.5 (0x7641c000)
        libQt5Core.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Core.so.5 (0x75fed000)
        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x75fc4000)
        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x75f0a000)
        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x75e95000)
        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75e6c000)
        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x75d7e000)
        /lib/ld-linux-armhf.so.3 (0x76f21000)
        libGL.so.1 => /usr/lib/arm-linux-gnueabihf/mesa/libGL.so.1 (0x75cfc000)
        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x75ce9000)
        libicui18n.so.55 => not found
        libicuuc.so.55 => not found
        libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x75c13000)
        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0x75bea000)
        libglapi.so.0 => /usr/lib/arm-linux-gnueabihf/libglapi.so.0 (0x75bac000)
        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0x75b91000)
        libXdamage.so.1 => /usr/lib/arm-linux-gnueabihf/libXdamage.so.1 (0x75b7f000)
        libXfixes.so.3 => /usr/lib/arm-linux-gnueabihf/libXfixes.so.3 (0x75b6b000)
        libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0x75b58000)
        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0x75a6a000)
        libxcb-glx.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-glx.so.0 (0x75a54000)
        libxcb-dri2.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri2.so.0 (0x75a49000)
        libxcb-dri3.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri3.so.0 (0x75a3f000)
        libxcb-present.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-present.so.0 (0x75a34000)
        libxcb-sync.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-sync.so.1 (0x75a28000)
        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0x75a0e000)
        libxshmfence.so.1 => /usr/lib/arm-linux-gnueabihf/libxshmfence.so.1 (0x759fc000)
        libXxf86vm.so.1 => /usr/lib/arm-linux-gnueabihf/libXxf86vm.so.1 (0x759f0000)
        libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0x759d6000)
        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x7597a000)
        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0x7596f000)
        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0x75963000)


[修改于 11 天前 - 2019-11-30 01:16:49]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
34楼

ldd libqxcb.so

libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0x760cf000)

libxkbcommon-x11.so.0 => not found

libxkbcommon.so.0 => /usr/lib/arm-linux-gnueabihf/libxkbcommon.so.0 (0x76092000)



apt-cache search libxkbcommon

libxkbcommon-dev - library interface to the XKB compiler - development files

libxkbcommon-x11-0 - library to create keymaps with the XKB X11 protocol

libxkbcommon-x11-dev - library to create keymaps with the XKB X11 protocol - development files

libxkbcommon0 - library interface to the XKB compiler - shared library






折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
35楼

 apt-get install apt-file 

apt-file update

apt-file search libz.so.1


搜索 so 文件 在什么包中




root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt# ./LinuxArmQtGuiApp

QML debugging is enabled. Only use this in a safe environment.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/opt/Qt5.12.4_ARM_Linux/plugins" This application failed to start because no Qt platform plugin could be initialized. Reinstalli

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb

Aborted (core dumped)

root@Ubuntu-mate:/opt# ^C

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt# export QT_DEBUG_PLUGINS=1

root@Ubuntu-mate:/opt# ./LinuxArmQtGuiApp

QML debugging is enabled. Only use this in a safe environment.

QFactoryLoader::QFactoryLoader() checking directory path "/opt/Qt5.12.4_ARM_Linux/plugins" ...

QFactoryLoader::QFactoryLoader() checking directory path "/opt" ...

QFactoryLoader::QFactoryLoader() looking at "/opt/LinuxArmQtGuiApp"

"Failed to extract plugin meta data from '/opt/LinuxArmQtGuiApp'"

         not a plugin

QFactoryLoader::QFactoryLoader() looking at "/opt/qt-everywhere-src-5.12.4-compile-completed.tar"

QElfParser: '/opt/qt-everywhere-src-5.12.4-compile-completed.tar' is not an ELF object

"'/opt/qt-everywhere-src-5.12.4-compile-completed.tar' is not an ELF object"

         not a plugin

QFactoryLoader::QFactoryLoader() looking at "/opt/QT_5.12.4_ARM_Linux_in_opt.tar"

QElfParser: '/opt/QT_5.12.4_ARM_Linux_in_opt.tar' is not an ELF object

"'/opt/QT_5.12.4_ARM_Linux_in_opt.tar' is not an ELF object"

         not a plugin

QFactoryLoader::QFactoryLoader() checking directory path "/opt/Qt5.12.4_ARM_Linux/plugins/platforms" ...

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqeglfs.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqeglfs.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "eglfs"

        ]

    },

    "archreq": 0,

    "className": "QEglFSIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("eglfs")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqlinuxfb.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqlinuxfb.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "linuxfb"

        ]

    },

    "archreq": 0,

    "className": "QLinuxFbIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("linuxfb")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqminimal.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqminimal.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "minimal"

        ]

    },

    "archreq": 0,

    "className": "QMinimalIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("minimal")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqminimalegl.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqminimalegl.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "minimalegl"

        ]

    },

    "archreq": 0,

    "className": "QMinimalEglIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("minimalegl")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqoffscreen.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqoffscreen.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "offscreen"

        ]

    },

    "archreq": 0,

    "className": "QOffscreenIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("offscreen")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqvnc.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqvnc.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "vnc"

        ]

    },

    "archreq": 0,

    "className": "QVncIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("vnc")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqwebgl.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqwebgl.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "webgl"

        ]

    },

    "archreq": 0,

    "className": "QWebGLIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("webgl")

QFactoryLoader::QFactoryLoader() looking at "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so"

Found metadata in lib /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so, metadata=

{

    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",

    "MetaData": {

        "Keys": [

            "xcb"

        ]

    },

    "archreq": 0,

    "className": "QXcbIntegrationPlugin",

    "debug": false,

    "version": 330752

}



Got keys from plugin meta data ("xcb")

QFactoryLoader::QFactoryLoader() checking directory path "/opt/platforms" ...

Cannot load library /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)

QLibraryPrivate::loadPlugin failed on "/opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so" : "Cannot load library /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so: (libxkbcommon-x11.so.0: cannot open shared object file: No such file or directory)"

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/opt/Qt5.12.4_ARM_Linux/plugins" even though it was found.

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.


Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb.


Aborted (core dumped)

root@Ubuntu-mate:/opt#







root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt# ldd /opt/Qt5.12.4_ARM_Linux/plugins/platforms/libqxcb.so

        libQt5XcbQpa.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5XcbQpa.so.5 (0x76e67000)

        libQt5Gui.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Gui.so.5 (0x76a7e000)

        libQt5Core.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5Core.so.5 (0x7664f000)

        libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0x76620000)

        libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76512000)

        libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76425000)

        /lib/ld-linux-armhf.so.3 (0x76f8b000)

        libfontconfig.so.1 => /usr/lib/arm-linux-gnueabihf/libfontconfig.so.1 (0x763e8000)

        libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0x76384000)

        libQt5DBus.so.5 => /opt/Qt5.12.4_ARM_Linux/lib/libQt5DBus.so.5 (0x76325000)

        libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x76301000)

        libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0x762ee000)

        libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0x762d7000)

        libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0x761e9000)

        libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76171000)

        libSM.so.6 => /usr/lib/arm-linux-gnueabihf/libSM.so.6 (0x7615b000)

        libICE.so.6 => /usr/lib/arm-linux-gnueabihf/libICE.so.6 (0x76139000)

        libxkbcommon-x11.so.0 => not found

        libxkbcommon.so.0 => /usr/lib/arm-linux-gnueabihf/libxkbcommon.so.0 (0x760fa000)

        libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x76024000)

        libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75ffc000)

        libGL.so.1 => /usr/lib/arm-linux-gnueabihf/mesa/libGL.so.1 (0x75f7a000)

        libicui18n.so.55 => /usr/lib/arm-linux-gnueabihf/libicui18n.so.55 (0x75de1000)

        libicuuc.so.55 => /usr/lib/arm-linux-gnueabihf/libicuuc.so.55 (0x75cc4000)

        libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x75cb1000)

        libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0x75ca6000)

        libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0x75c99000)

        libexpat.so.1 => /lib/arm-linux-gnueabihf/libexpat.so.1 (0x75c71000)

        libz.so.1 => /lib/arm-linux-gnueabihf/libz.so.1 (0x75c4f000)

        libpng12.so.0 => /lib/arm-linux-gnueabihf/libpng12.so.0 (0x75c27000)

        libdbus-1.so.3 => /lib/arm-linux-gnueabihf/libdbus-1.so.3 (0x75be8000)

        libuuid.so.1 => /lib/arm-linux-gnueabihf/libuuid.so.1 (0x75bd3000)

        libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0x75b77000)

        libglapi.so.0 => /usr/lib/arm-linux-gnueabihf/libglapi.so.0 (0x75b39000)

        libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0x75b1e000)

        libXdamage.so.1 => /usr/lib/arm-linux-gnueabihf/libXdamage.so.1 (0x75b0c000)

        libXfixes.so.3 => /usr/lib/arm-linux-gnueabihf/libXfixes.so.3 (0x75af7000)

        libxcb-glx.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-glx.so.0 (0x75ae1000)

        libxcb-dri2.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri2.so.0 (0x75ad6000)

        libxcb-dri3.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri3.so.0 (0x75acc000)

        libxcb-present.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-present.so.0 (0x75ac2000)

        libxcb-sync.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb-sync.so.1 (0x75ab5000)

        libxshmfence.so.1 => /usr/lib/arm-linux-gnueabihf/libxshmfence.so.1 (0x75aa3000)

        libXxf86vm.so.1 => /usr/lib/arm-linux-gnueabihf/libXxf86vm.so.1 (0x75a97000)

        libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0x75a7e000)

        libicudata.so.55 => /usr/lib/arm-linux-gnueabihf/libicudata.so.55 (0x741b7000)

        libsystemd.so.0 => /lib/arm-linux-gnueabihf/libsystemd.so.0 (0x7418c000)

        librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x74176000)

        liblzma.so.5 => /lib/arm-linux-gnueabihf/liblzma.so.5 (0x74156000)

        libgcrypt.so.20 => /lib/arm-linux-gnueabihf/libgcrypt.so.20 (0x740c7000)

        libgpg-error.so.0 => /lib/arm-linux-gnueabihf/libgpg-error.so.0 (0x740ab000)

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#

root@Ubuntu-mate:/opt#



apt-get install libxkbcommon-dev libxkbcommon-x11-dev 







Got keys from plugin meta data ("xcb_glx")

QFactoryLoader::QFactoryLoader() checking directory path "/opt/xcbglintegrations" ...

loaded library "/opt/Qt5.12.4_ARM_Linux/plugins/xcbglintegrations/libqxcb-glx-integration.so"

./LinuxArmQtGuiApp: symbol lookup error: /opt/Qt5.12.4_ARM_Linux/lib/libQt5XcbQpa.so.5: undefined symbol: FT_Get_Font_Format

root@Ubuntu-mate:/opt#



apt-get install libfreetype6

[修改于 9 天前 - 2019-12-01 17:38:02]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
36楼

root@FriendlyARM:/opt/armapp# ./armapp

QML debugging is enabled. Only use this in a safe environment.

main()

app(argc, argv)

 QObject::connect()

./armapp: symbol lookup error: /opt/Qt5.12.4_ARM_Linux/lib/libQt5XcbQpa.so.5: undefined symbol: FT_Get_Font_Format

root@FriendlyARM:/opt/armapp# libQt5XcbQpa.so.5: undefined symbol: FT_Get_Font_Format



libQt5XcbQpa.so.5:: command not found


root@FriendlyARM:/opt/armapp#




root@FriendlyARM:/opt/armapp# apt-cache search libfreetype

libfreetype6 - FreeType 2 font engine, shared library files

libfreetype6-dev - FreeType 2 font engine, development files

libgd-perl - Perl module wrapper for libgd

libcoin80v5 - high-level 3D graphics kit implementing the Open Inventor API

root@FriendlyARM:/opt/armapp# apt-get install libfreetype6




https://stackoverflow.com/questions/56039011/how-to-solve-a-symbol-look-up-error-on-qt-installation-on-ubuntu

[修改于 10 天前 - 2019-11-30 13:49:53]

折叠评论
加载评论中,请稍候...
折叠评论
张静茹(作者)
37楼

至此 所有问题都解决了,linux arm app 跑起来了

image.png


[修改于 10 天前 - 2019-11-30 13:28:46]

折叠评论
加载评论中,请稍候...
折叠评论
2019-12-01 18:54:42
2019-12-1 18:54:42
张静茹(作者)
38楼

https://stackoverflow.com/questions/18648257/how-to-implement-wpf-like-mvvm-in-qt-c-qml

How to implement WPF-like MVVM in Qt/C++/QML?

Ask Question

Asked 6 years, 2 months ago

Active 2 years, 7 months ago

Viewed 13k times

11

4

I'm writing a proof of concept application, that is very simple. Basically it's composed of a UI where a list of "Note" type objects is displayed in a QML ListView.

I then have a few classes which is something along the lines:

#ifndef NOTE_H
#define NOTE_H

#include <string>

using namespace std;
class Note
{
public:
    Note(QObject* parent = 0)
        : QObject(parent)
    {

    }

    Note(const int id, const string& text)
        : _id(id), _text(text)
    {
    }

    int id()
    {
        return _id;
    }

    const string text()
    {
        return _text;
    }

    void setText(string newText)
    {
        _text = newText;
    }

private:
    int _id;
    string _text;
};

#endif // NOTE_H

Then a repository:

class NoteRepository : public Repository<Note>
{
public:
    NoteRepository();
    ~NoteRepository();

    virtual shared_ptr<Note> getOne(const int id);
    virtual const unique_ptr<vector<Note>> getAll();
    virtual void add(shared_ptr<Note> item);
private:
    map<int, shared_ptr<Note>> _cachedObjects;
};

Finally a ViewModel that exposes Note to QML

class MainViewModel : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QQmlListProperty<Note> notes READ notes NOTIFY notesChanged)
    Q_PROPERTY(int count READ count() NOTIFY countChanged)
public:
    MainViewModel(QObject *newParent = 0);
    int count();
    QQmlListProperty<Note> notes();
signals:
    void notesChanged();
    void countChanged();
public slots:
private:
    std::shared_ptr<UnitOfWork> _unitOfWork;
    static void appendNote(QQmlListProperty<Note> *list, Note *note);
    QList<Note*> _notes;
};

PLEASE DON'T MIND ANY C++ MISTAKES HERE and mind they are incomplete, it's not the point at this moment as I'm constantly adapting this as I learn.

The point where I'm struggling is, how to expose a list-like object to QML? The requirement is this list must be dynamic, one should be able to add, delete and modify the text of a note. When the list is modified by C++, it should also notify the UI (signal).

I tried QQmlListProperty, but couldn't figure a way of exposing it to QML. Then I read on another SO post this type can't be modified by QML (??), and I stumbled upon QAbstractItemModel.

Anyhow, can anyone point me to the right direction?

   




johnildergleidisson

1,85933 gold badges2727 silver badges4545 bronze badges

add a comment

1 Answer

activeoldestvotes

9

I've posted a rather complete example in another answer.

The general procedure is:

  1. Create a model that derives from QAbstractItemModel. You can reuse any of the models already provided by Qt, for example QStringListModel.

  2. Expose it to QML. E.g. use setContextProperty() of QML Engine's rootContext().

  3. The model's roles are visible in the context of the delegate in QML. Qt provides default mapping between names and roles for the DisplayRole (display) and EditRole (edit) in a default implementation of roleNames().

    delegate: Component {
        TextInput {
            width: view.width // assuming that view is the id of the view object
            text: edit // "edit" role of the model, to break the binding loop
            onTextChanged: model.display = text // "display" role of the model
        }
    }
  4. You can create intermediate viewmodels, if needed, by attaching proxy models between the views and the backend models. You can derive from QAbstractProxyModel or one of its subclasses.


折叠评论
加载评论中,请稍候...
折叠评论
2019-12-03 23:13:53
2019-12-3 23:13:53
张静茹(作者)
39楼

./LinuxArmQtGuiApp -platform linuxfb 以linuxfb 启动 应用程序

折叠评论
加载评论中,请稍候...
折叠评论
2019-12-05 23:56:07
2019-12-5 23:56:07
张静茹(作者)
40楼



# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted


## Major bug fix updates produced after the final release of the

## distribution.

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted


## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team. Also, please note that software in universe WILL NOT receive any

## review or updates from the Ubuntu security team.

deb http://ports.ubuntu.com/ubuntu-ports/ bionic universe

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic universe

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates universe


## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu

## team, and may not be under a free licence. Please satisfy yourself as to

## your rights to use the software. Also, please note that software in

## multiverse WILL NOT receive any review or updates from the Ubuntu

## security team.

deb http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic multiverse

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse


## N.B. software from this repository may not have been tested as

## extensively as that contained in the main release, although it includes

## newer versions of some applications which may provide useful features.

## Also, please note that software in backports WILL NOT receive any review

## or updates from the Ubuntu security team.

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse


## Uncomment the following two lines to add software from Canonical's

## 'partner' repository.

## This software is not part of Ubuntu, but is offered by Canonical and the

## respective vendors as a service to Ubuntu users.

deb http://archive.canonical.com/ubuntu bionic partner

deb-src http://archive.canonical.com/ubuntu bionic partner


deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security universe

deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse

deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security multiverse












deb http://http.debian.net/debian/ stretch main contrib non-free

deb-src http://http.debian.net/debian/ stretch main contrib non-free

deb http://security.debian.org/ stretch/updates main contrib non-free

deb-src http://security.debian.org/ stretch/updates main contrib non-free

deb http://http.debian.net/debian/ stretch-updates main contrib non-free

deb-src http://http.debian.net/debian/ stretch-updates main contrib non-free

deb http://ftp.de.debian.org/debian stretch main 






https://mirrors.ustc.edu.cn/repogen/

中科大 sources.list 生成器


http://mirrors.ustc.edu.cn/help/debian.html

http://mirrors.ustc.edu.cn/

[修改于 3 天前 - 2019-12-07 16:26:58]

折叠评论
加载评论中,请稍候...
折叠评论
2019-12-06 00:07:25
张静茹(作者)
41楼
折叠评论
加载评论中,请稍候...
折叠评论
2019-12-07 15:15:19
2019-12-7 15:15:19
张静茹(作者)
42楼

debian 系统解压xz文件失败


tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now


apt-get install bzip2

apt install -y xz-utils


折叠评论
加载评论中,请稍候...
折叠评论
2019-12-08 04:34:17
张静茹(作者)
43楼

U盘被写保护在本电脑,但在别的电脑又可以写入怎么解除

2019-04-01 09:52 来源: 本站整理 作者:电脑爱好者 浏览量:17410次

    不知道大家有没有遇到过,U盘在自己的电脑上提示写保护,不能写入数据,只能读取,但把U盘插其他电脑又可以读写数据。其实这种情况一般都可以排除U盘本身的问题,问题的关键在你自己的电脑系统上面,如果你直接重装系统那么就不用看了,下面就教大家如何解决系统导致的U盘被写保护怎么解除的问题,在不重装的情况下。

  方法一、修改注册表的方式来解除写保护

  “Win+R”组合键后输入“regedit”进入注册表编辑器,(也可以在开始-运行里输入CMD然后输入regedit)定位到

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

新建“项”,命名为“StorageDevicePolicies”,如果有了直接双击进入。

然后在新建“项“下新建“DWORD(32位)值”,命名为”WriteProtect“,并双击修改”数值数据“为0。

  然后以管理员的身份运行命令提示符(就是之前说的开始-运行-cmd后的命令界面),执行“diskpart”。
  等进入diskpart后运行“list disk”可以看到电脑上的磁盘列表,根据容量大家自己判断下哪个是外接的U盘。

然后执行下面的命令选取U盘:
select disk n(n指代U盘序号,从上图列表中确定,本文示例选1)
接下来只要输入
attributes disk clear readonly
就可以解除该U盘的“写保护”状态。

方法二、如果还不行,看看这个系统路径下C:\Windows\System32\drivers,有没有一个名为sptd.sys的文件,如果有的话,删除重启就行了。没有的话也别心急,继续往下看:
  regedit命令直接进入注册表,定位到
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\usbehci
项目后,查看右侧“start”的数值数据,如果不是默认的“3”,而是“2”或者“4”改回来,重启电脑。

方法三、以上这些都不行的话,可以利用第3方工具来解决。推荐并下载大势至电脑文件防泄密系统,它功能有点多,主要是防止它人盗取数据,这里只需要用它某一项功能,就可以彻底解除U盘被写保护锁定的状态。

  打开软件后,照上图先选择“恢复USB存储设备、手机或蓝牙等设备的使用”,然后再选择同在一个红框中的“可以从电脑向U盘拷贝资料,但必须输入管理员密码”,输入软件默认的“123”密码后再看U盘是否已经不在提示写保护了呢。

  所以系统导致的U盘被写保护,主要就是对系统本身进行修改,当然你也可以重装一下系统,绝对是可以解决的,但装系统很麻烦又要从新打补丁,上面的方法一般都是可以解决的。


[修改于 2 天前 - 2019-12-08 04:34:37]

折叠评论
加载评论中,请稍候...
折叠评论

想参与大家的讨论?现在就 登录 或者 注册

插入资源
全部
图片
视频
音频
附件
全部
未使用
已使用
正在上传
空空如也~
上传中..{{f.progress}}%
处理中..
上传失败,点击重试
{{f.name}}
空空如也~
(视频){{r.oname}}
{{selectedResourcesId.indexOf(r.rid) + 1}}
ID:{{user.uid}}
{{user.username}}
{{user.info.certsName}}
{{user.description}}
{{format("YYYY/MM/DD", user.toc)}}注册,{{fromNow(user.tlv)}}活动
{{submitted?"":"投诉"}}
请选择违规类型:
{{reason.description}}
支持的图片格式:jpg, jpeg, png