一.在线安装

        1.可以到官网地址:https://download.qt.io/official_releases/online_installers/ 下载 qt-unified-linux-x64-online.run 安装文件。

        2.修改文件权限为可执行权限,chmod  +x qt-unified-linux-x64-online.run

        3.然后运行 ./qt-unified-linux-x64-online.run

        4. 输入Qt账号,没有注册一个.

        5.然后按照提示,一步一步安装 .(注意:QT需要磁盘至少有27G的空间)

       

二. 启动qtcreator

     进入到安装目录的 QtCreator的  bin 目录里,然后执行./qtcreator。

    如果报一下错:Could not load the Qt platform plugin “xcb“ in ““ even though it was found .,,,,,

     可以执行在 .bashrc文件里添加 export QT_DEBUG_PLUGINS=1    ,然后source .bashrc.

     再次启动qtcreator, 如果还是报libxcb-cursor. so. 0: cannot open shared object file: No such file

      or directory

     则需要安装  sudo apt install libxcb-cursor0 。

    然后就可以正常启动qtcreator了。

三. 创建一个HelloWorld例子

     选择创建Create Project” --> “Application(Qt)” --> “Qt Widget Application

     创建完成后,点击执行按钮。

    如果报错GL/gl.h: No such file or directory, 则需要安装opengl库,

     sudo apt-get install libglu1-mesa-dev

     然后再次运行即可。

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐