The task is to create a windowing application (Windows) that has a small executable file and does not contain dependencies on external libraries. For example, if you write using Qt and put the necessary libraries into an exe-file, the size of this file will be several tens of megabytes.

What are the alternatives for creating window applications with an executable file of minimum size (at least <5 MB)? Cross-platform is not needed.

UPDATE

Alternative frameworks are suggested in the comments to the answer.

    2 answers 2

    Clean WinAPI . Available with the MFC library.

    exe-shnik will link dynamically with the necessary libraries that come with Windows.

    A simple game with a computer opponent, drawing on WM_PAINT and with a menu takes me 128kB (in the Release assembly).

    • That on pure WinAPI, that on MFC it is difficult to write code, long and tedious. I would like to go more convenient way. - DarkGenius
    • @DarkGenius: I'm afraid a more convenient way is to use frameworks. And why do we need a small size? 2015 is still, the Internet is fast for everyone. - VladD
    • @DarkGenius Here you are, [FLTK] [1]. In the documentation, they boast that> The "core" (the "hello" FLTK library using gcc on a 486 and then stripped) is 114K. [1]: fltk.org - atwice
    • @DarkGenius, I still brought you: [Ultimate ++] [1]. In [article] [2] they write that exe will weigh 2-3 MB. > According to the developers, the average size of the executable file for a full-featured application that uses the Ultimate ++ library to create is 2-3 MB. The development environment itself, created, naturally, with the help of the same library, occupies 3.5 MB (this is an executable file - EXE). [1]: en.wikipedia.org/wiki/Ultimate%2B%2B [2]: kv.by/index2007261105.htm - atwice
    • one
      > A simple game with a computer opponent, drawing on WM_PAINT and with a menu, it takes me 128kB (in the Release assembly). Wrong you have chosen a comparison vector. The advantage of WinAPI is not in size. With WinAPI you can do everything that can not be done using frameworks. Or it should be done bypassing the logic of these frameworks. Therefore, tool selection should be well weighed. The project on complex tools may simply not be completed. You are wasting money and time wasted at the design stage, choosing WinAPI simply because it is cool. - mega
    "затруднительно, долго и нудно" 

    This is only at first, then you will impart your modules, and everything will be written quickly.

     "2015 год всё же, интернет у всех быстрый." 

    It's not about the Internet at all, the right thought for a person. If the program I need, found on the network, takes more than 2-3mb, I do not use it, because it indicates the programmer’s curvature or laziness, when this functionality could be pushed into 500kb.

     The "core" (the "hello" program compiled & linked with a static FLTK library using gcc on a 486 and then stripped) is 114K. 

    1.14k it should max. borrow, and assembler again in 10-20 less) t.ch. nothing to brag about.

    • @Isaev: Well, you want small programs, write in C # :) Using frameworks is not about curvature, but about programmer pragmatism, since small programs are usually obtained only if you write everything manually. - VladD
    • 3
      > then you will make your modules In which will be your own unknown bugs. > If the program I need, found on the network, takes more than 2-3mb, I do not use it. I sympathize. > because it says about the programmer's curvature or laziness Or that the programmer values ​​his time. - Nofate
    • one
      @avp, lib, written by an abstract, self-assured Vasya Pupkin or some kind of framework with a normal development process, bugtracking and so on? I vote not in favor of Vasya) Just because the known lib is run-in for a large number of users, for it there are known issues, sets of elegant checked crutches and tickets in jr. And its own tested only on itself, the representativeness of the sample - so-so. - Nofate
    • one
      @Isaev: in fairness, I note that the struggle for every byte makes sense only in small projects in which you can afford the luxury of abandoning abstraction. In non-toy projects with millions of lines of code, it’s impossible to optimize each line: there is not enough human life. - VladD
    • 2
      @Isaev, in the end, everything depends on the task that has been set. If it is possible to save time and energy not to the detriment of the result and the environment, then I see no reason to go a more complicated way. We must weigh the pros and cons and do not allow our time to useless and unnecessary things. -------- And excel weighs so much at the expense of the graphic component and design delights only after the 2000s, unlike the first versions of 1.5mb from the 90s , which no one forbids using;) - Alex Krass