原文:https://wiki.archlinux.org/index.php/Qt_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E5%BC%80%E5%8F%91

C++

  • Package:
    • qt4AUR - Version 4.x of the Qt toolkit.
    • qt5-base - Version 5.x of the Qt toolkit.
  • Website: http://qt-project.org/
  • Build:
    • The Qt4 version: g++ $(pkg-config --cflags --libs QtGui) -o hello hello.cpp
    • The Qt5 version: g++ $(pkg-config --cflags --libs Qt5Widgets) -fPIC -o hello hello.cpp
  • Run with: ./hello
//hello.cpp
#include <QApplication>
#include <QLabel>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
    QLabel hello("Hello world!");

    hello.show();
    return app.exec();
}