[Interest] Installation Sizes for Applications using Qt
Ben Cottrell
bencot at windowslive.com
Sat Aug 28 03:02:32 CEST 2021
Yes, I've tried configure with these command line arguments:
./configure -opensource -confirm-license -platform linux-g++ -prefix
/opt/6.1.2-linux-g++-static -static
I got lots of errors after running configure, about missing XCB
libraries, so following the Ubuntu CI script, I installed them with:
apt install "^libxcb.*"
I installed this on Debian 11.
I managed to build a test project with cmake containing this code:
cmake_minimum_required(VERSION 3.20)
project(untitled)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_LINKER ld.gold)
set(CMAKE_PREFIX_PATH "/opt/6.1.2-linux-g++-static/lib/cmake")
find_package(Qt6 COMPONENTS
Core
Gui
Widgets
REQUIRED)
add_executable(untitled main.cpp)
target_link_libraries(untitled
Qt::Core
Qt::Gui
Qt::Widgets
)
Here's the source to main.cpp:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
QPushButton button("Hello world!", nullptr);
button.resize(200, 100);
button.show();
return QApplication::exec();
}
Afterwards, I used strip on untitled, reducing the size to 16MB. If I
give it to people, I'll provide the object file if they want to relink
it.
On Fri, 2021-08-27 at 12:36 +0200, Joerg Bornemann wrote:
> On 8/27/21 2:32 AM, Ben Cottrell wrote:
> > So Qt makes sense for large applications, but for smaller ones,
> > it's
> > more efficient to use individual libraries per platform.
> >
> > Until Qt is more easily configurable, I cannot justify using it's
> > libraries in small applications.
>
> Did you try one of the suggestions?
> If so, maybe you could state why it's not easy enough for you, so we
> can
> try to improve it.
>
> Joerg
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.qt-project.org%2Flistinfo%2Finterest&data=04%7C01%7C%7C7c56279459ce42f48e4808d96946d4f3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637656575208944526%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LeAqqydw%2FtS05L0uuxzxQ4rhe8WHvuPZZ1umZUoM3Zs%3D&reserved=0
More information about the Interest
mailing list