QT官网
利用wget下载清华镜像的qtcreator。
wget http://mirrors.tuna.tsinghua.edu.cn/qt/official_releases/qtcreator/4.14/4.14.2/qt-creator-opensource-linux-x86_64-4.14.2.run
此处不建议使用curl进行下载,可能会出现文件不完整的情况。
如果下载的run文件无法执行,确认一下文件大小是否在214.6 MB左右。如果文件偏小,可能是下载失败。
chmod 744 qt-creator-opensource-linux-x86_64-4.14.2.run
./qt-creator-opensource-linux-x86_64-4.14.2.run
此时会运行一个QT的安装界面,输入QT账号,确认安装目录。
如果在运行时,遇到下面的问题。可能是缺少库导致的。
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" 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.
调查问题原因:
在~/.bashrc中添加export QT_DEBUG_PLUGINS=1
执行source ~/.bashrc
重新运行./qtcreator
,得到下面的信息。
Cannot load library /home/leon/bin/qtcreator-4.14.2/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/leon/bin/qtcreator-4.14.2/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/leon/bin/qtcreator-4.14.2/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
根据上面的提示信息,是libqxcb.so
出现了问题。
执行libqxcb.so
,获得lib库的详细信息。得到下面的信息。
libxcb-xinerama.so.0 => not found
原因是libxcb-xinerama未找到导致的问题。执行sudo apt install libxcb-xinerama0
。问题成功解决。
手机扫一扫
移动阅读更方便
你可能感兴趣的文章