> How huge is "weirdly huge"? Does your executable depend on any MinGWDLLs, like libstdc++-6.dll?
I linked all libraries statically, before that it depended on libgcc_s_dw2-1.dll and libwinpthread-1.dll, and probably something else too. It was around 500 KiB originally, now it is almost 1000 KiB. > The code in the "std" namespace is generally provided by libstdc++v3, which is a component of GCC and can be found in the GCC source:ftp://ftp.gnu.org/gnu/gcc/ You haven't said what version of GCC you are using or what distribution of mingw-w64, so it's hard to point you to the exact source. Here is the output of my g++ -v $ g++ -v Using built-in specs. COLLECT_GCC=C:\msys64\mingw32\bin\g++.exe COLLECT_LTO_WRAPPER=C:/msys64/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.3.0/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../gcc-6.3.0/configure --prefix=/mingw32 --with-local-prefix=/mingw32/local --build=i686-w64-mingw32 --host=i686-w64-mingw32 --target=i686-w64-mingw32 --with-native-system-header-dir=/mingw32/i686-w64-mingw32/include --libexecdir=/mingw32/lib --enable-bootstrap --with-arch=i686 --with-tune=generic --enable-languages=c,lto,c++,objc,obj-c++,fortran,ada --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw32 --with-mpfr=/mingw32 --with-mpc=/mingw32 --with-isl=/mingw32 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld --disable-sjlj-exceptions --with-dwarf2 Thread model: posix gcc version 6.3.0 (Rev3, Built by MSYS2 project) >I'd recommend using printf, like those other people you talked to. The code for that is provided by Microsoft in msvcrt.dll so it won't be part of your executable. Is it possible to make something that will look like cout << "some string", but will just redirect to printf internally and be more lightweight? I'm very new to C++ to mess with runtime by myself. >Also, did you remember to run the binutils "strip" utility on your executable before deciding it was huge? Yes, there is "-s" in linking flags, should be the same thing. Sorry if formatting or something else is wrong, second time using mailing lists. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public