Skip to content

Instantly share code, notes, and snippets.

@knoguchi
Last active August 20, 2019 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knoguchi/d44795cf6f361c74829df046157756b3 to your computer and use it in GitHub Desktop.
Save knoguchi/d44795cf6f361c74829df046157756b3 to your computer and use it in GitHub Desktop.
Minimal Qt5 devenv setup in Linux
# TODO: find the minimal package.
apt install qt5-default qtcreator
# Steps to create Qt app.
# 1. create main.cpp
# 2. create .pro file
# 3. create Makefile from .pro file
# 4. run make
# create a main.cpp
cat > main.cpp <<<EOF
#include <QtCore>
#include <iostream>
int main() {
std::cout << "Qt version: " << qVersion() << std::endl;
}
EOF
# Create the project file "qt.pro"
qmake -project
# Create "Makefile"
qmake qt.pro
# add following line in the qt.pro file. Any reasonable qt app projects need this.
QT += widgets
# make
# it runs
# g++ -Wl,-O1 -o qt version.o -lQt5Gui -lQt5Core -lGL -lpthread
# run the app
./qt
# For embedded Linux without X11 see https://doc.qt.io/qt-5/embedded-linux.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment