You can also use a non-monolithic, static build and only link to the bare minimum set of libraries. That will include significantly less code (if you don't use most of wxWidgets), but it is also significantly more maintenance work.
Also, you can edit setup.h and disable everything that you don't need (image loading, joysticks,... whatever). This is even more maintenance work and you can quite easily break something.
Both "solutions" (if you want to call them solutions) require recompiling wxWidgets.
Finally, you can also use a different linker (and/or compiler). UltimateCPP is said to have a custom, significantly better linker compatible to gcc. In my experience, it is none better, but during ~20 builds, it crashed twice (after that, I removed it).
There is yet another
ld replacement whose name I forgot, but I think it was mainly optimized for link speed.
The DM and MS compilers produce significantly smaller wxWidgets libraries. If size is all that matters, you should try those.
Personally, I don't think it matters at all any more. A few years ago, I was very concerned about such things as executable size, but
big M is notorious about wasting resources in the most outrageous way, and consequently both storage and bandwidth have become a lot cheaper to the end user
I mean, look around, you will hardly find a PC with less than a 3-digit Gigabyte hard disk space, and very few users actually have less than 1-2 MBits/s network connection.
If you are concerned about repeatedly uploading to a FTP server or something, you may want to try
rsync or
bsdiff or anything like that. Depending on what you do, those work wonders