在travis-ci linux上安装Qt5.13

问题描述 投票:0回答:2

首先,我尝试使用apt-get install qtchooser libgl-dev qt5-default qttools5-dev-tools python3.6 qtwebengine5-dev安装Qt。但是,这将安装5.9的Qt版本。我已经尝试通过使用

来安装Qt
sudo wget http://download.qt.io/official_releases/qt/5.13/5.13.1/qt-opensource-linux-x64-5.13.1.run;
sudo chmod +x ./qt-opensource-linux-x64-5.13.1.run;
sudo ./qt-opensource-linux-x64-5.13.1.run;

这给另一个错误:

QStandardPaths: wrong ownership on runtime directory /run/user/2000, 2000 instead of 0
qt.qpa.screen: QXcbConnection: Could not connect to display 
Could not connect to any X display

在travis-ci linux上安装Qt 5.13的正确解决方案是什么?

linux qt travis-ci
2个回答
0
投票

您可以使用Stephan Binner的启动板存储库之一,其中包含最新的Qt版本。

例如,如果要使用Qt 5.13.1,则可以在.travis.ymlinstall部分中编写以下内容(假设您使用xenial构建图像:]

sudo apt-add-repository -y ppa:beineri/opt-qt-5.12.1-xenial &&
travis_wait 30 sudo apt-get -qq update &&
sudo apt-get -qq install qt512tools qt512base &&
source /opt/qt512/bin/qt512-env.sh

根据需要添加其他Qt软件包。

也请注意您所看到的错误之一:关于无法连接至任何X显示器的错误。如果要在Travis CI上运行的任何程序通常都需要运行GUI,则可以使用xvfb解决此问题:要使其正常工作,您需要在.travis.yml的顶层添加以下内容:

services:
        - xvfb

0
投票

尝试在您的travis配置中手动添加ppa:

- os: linux
  dist: bionic
  sudo: require
  addons:
    apt:
      sources:
        - sourceline: 'ppa:beineri/opt-qt-5.13.2-bionic'
      packages:
        - qt513base
© www.soinside.com 2019 - 2024. All rights reserved.