2 ms·
hello.cpp: #include <QLabel> #include <QApplication> int main(int argc, char** argv) { QApplication app{argc, argv}; QLabel label{
by jcelerier 9y ago
hello.cpp:
#include <QLabel>
#include <QApplication>
int main(int argc, char** argv)
{
QApplication app{argc, argv};
QLabel label{"hello world!"};
label.show();
return app.exec();
}
build:
$ g++ -O2 -g0 -fPIC hello.cpp -I/usr/include/qt -I/usr/include/qt/QtWidgets -lQt5Widgets -lQt5Core
$ du -csh a.out
16K a.out
seriously...
- joezydeco 9y agoTry it again with Qt configured for -static and not -dynamic.
- sirspudd 9y agoI compile a Qt Quick application statically for the Raspberry Pi on a regular basis, and the whole binary is around 7 megs big. If you remove Qt Declarative (Your hello world just requires QtCore) it will be a fraction of this size. So nice to see people fabricating numbers and passing them off as data.