Hacker News new | ask | show | jobs
by jcelerier 2978 days 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...
1 comments

Try it again with Qt configured for -static and not -dynamic.
I 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.