在共享文件夹里将WINDOWS里已经编写好的QT程序编译之后,提示
Qt5: Unknown module(s) in QT: serialport
经查询,
在共享文件夹里将WINDOWS里已经编写好的QT程序编译之后,提示
Qt5: Unknown module(s) in QT: serialport
经查询,需要安装对应的模块库,写入
sudo apt-get install libqt5serialport5-dev libudev-dev
但命令端提示
“无法定位软件包”
经查询,是软件源需要进行更新,国内比较常用的是清华的软件源
首先
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old //先把源文件复制到sources.list.old
然后对etc/apt/里的sources.list进行修改,我这里由于一直设置的只读,因此采用的vim修改,即
cd /etc/apt/
sudo vim sources.list
弹出编辑页面,将软件源复制进去
我这里采用的是
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 4.0.2sp2-desktop main restricted universe multiverse
注意:银河麒麟系统里每个“https”都要改为“http”,否则识别不出。当地址变红说明格式正确
改完后,按esc按钮,再按":"可输入执行指令,按回车键结束
一般是采用“w”保存,“q”退出。由于我的文件是只读且权限是root,因此采用了
:w !sudo tee %
进行保存。
退出修改界面后,可在窗口上查看文件是否发生变化
确定修改完毕后,保持联网状态,输入
sudo apt-get update
可能会出现这个问题
E: 无法获得锁 /var/lib/apt/lists/lock - open (11: 资源暂时不可用)
E: 无法对目录 /var/lib/apt/lists/ 加锁
这时进行解锁
sudo rm /var/lib/apt/lists/lock
然后再进行更新
sudo apt-get update
一般就没问题了
等待软件源更新完毕之后,再安装对应的模块库
sudo apt-get install libqt5serialport5-dev libudev-dev
安装完毕后编译qt,模块已成功下载,该问题已解决。
下面是QT依赖的所有的库,构建运行过程中缺少哪一个库,找到后执行sudo apt-get install+库
libqt53danimation5 libqt5networkauth5-dev libqt5sql5-psql-dbgsym
libqt53dcore5 libqt5nfc5 libqt5sql5-sqlite
libqt53dextras5 libqt5opengl5 libqt5sql5-sqlite-dbgsym
libqt53dinput5 libqt5opengl5-dbgsym libqt5sql5-tds
libqt53dlogic5 libqt5opengl5-dev libqt5sql5-tds-dbgsym
libqt53dquick5 libqt5pas1 libqt5svg5
libqt53dquickanimation5 libqt5pas-dev libqt5svg5-dbgsym
libqt53dquickextras5 libqt5positioning5 libqt5svg5-dev
libqt53dquickinput5 libqt5positioning5-dbgsym libqt5test5
libqt53dquickrender5 libqt5positioning5-plugins libqt5test5-dbgsym
libqt53dquickscene2d5 libqt5positioning5-plugins-dbgsym libqt5texttospeech5
libqt53drender5 libqt5positioningquick5 libqt5texttospeech5-dbgsym
libqt5bluetooth5 libqt5positioningquick5-dbgsym libqt5texttospeech5-dev
libqt5bluetooth5-bin libqt5printsupport5 libqt5waylandclient5
libqt5charts5 libqt5printsupport5-dbgsym libqt5waylandclient5-dbgsym
libqt5charts5-dev libqt5qevercloud3 libqt5waylandclient5-dev
libqt5concurrent5 libqt5qml5 libqt5waylandcompositor5
libqt5concurrent5-dbgsym libqt5qml5-dbgsym libqt5waylandcompositor5-dbgsym
libqt5core5a libqt5quick5 libqt5waylandcompositor5-dev
libqt5core5a-dbgsym libqt5quick5-dbgsym libqt5webchannel5
libqt5datavisualization5 libqt5quickcontrols2-5 libqt5webchannel5-dbgsym
libqt5datavisualization5-dev libqt5quickcontrols2-5-dbgsym libqt5webchannel5-dev
libqt5dbus5 libqt5quickparticles5 libqt5webengine5
libqt5dbus5-dbgsym libqt5quickparticles5-dbgsym libqt5webengine5-dbgsym
libqt5designer5 libqt5quicktemplates2-5 libqt5webenginecore5
libqt5designer5-dbgsym libqt5quicktemplates2-5-dbgsym libqt5webenginecore5-dbgsym
libqt5designercomponents5 libqt5quicktest5 libqt5webengine-data
libqt5designercomponents5-dbgsym libqt5quicktest5-dbgsym libqt5webenginewidgets5
libqt5gamepad5 libqt5quickwidgets5 libqt5webenginewidgets5-dbgsym
libqt5gamepad5-dev libqt5quickwidgets5-dbgsym libqt5webkit5
libqt5glib-2.0-0 libqt5scintilla2-designer libqt5webkit5-dbgsym
libqt5gstreamer-1.0-0 libqt5script5 libqt5webkit5-dev
libqt5gstreamer-dev libqt5script5-dbgsym libqt5websockets5
libqt5gstreamerquick-1.0-0 libqt5scripttools5 libqt5websockets5-dev
libqt5gstreamerui-1.0-0 libqt5scripttools5-dbgsym libqt5webview5
libqt5gstreamerutils-1.0-0 libqt5sensors5 libqt5webview5-dev
libqt5gui5 libqt5sensors5-dbgsym libqt5widgets5
libqt5gui5-dbgsym libqt5sensors5-dev libqt5widgets5-dbgsym
libqt5help5 libqt5serialbus5 libqt5x11extras5
libqt5help5-dbgsym libqt5serialbus5-bin libqt5x11extras5-dev
libqt5keychain1 libqt5serialbus5-dev libqt5xdg3
libqt5location5 libqt5serialbus5-plugins libqt5xdg3-dbgsym
libqt5location5-dbgsym libqt5serialport5 libqt5xdg-dev
libqt5location5-plugins libqt5serialport5-dev libqt5xdgiconloader3
libqt5location5-plugins-dbgsym libqt5sql5 libqt5xdgiconloader3-dbgsym
libqt5multimedia5 libqt5sql5-dbgsym libqt5xdgiconloader-dev
libqt5multimedia5-plugins libqt5sql5-ibase libqt5xdgiconloader-dev-dbgsym
libqt5multimediagsttools5 libqt5sql5-ibase-dbgsym libqt5xml5
libqt5multimediaquick5 libqt5sql5-mysql libqt5xml5-dbgsym
libqt5multimediawidgets5 libqt5sql5-mysql-dbgsym libqt5xmlpatterns5
libqt5network5 libqt5sql5-odbc libqt5xmlpatterns5-dev
libqt5network5-dbgsym libqt5sql5-odbc-dbgsym
libqt5networkauth5 libqt5sql5-psql