I like TCC because it's small, requires no installation, and can be called to compile any .c file into any .exe through start arguments of tcc.exe.

So I basically need exactly that for C++.

It should need no installation (it just sits in a folder, extracted from a zip), and can compile any .cpp through start arguments of the compiler exe.

It also needs to be portable like TCC meaning you don't have to compile it for every PC you put it on.

  • 5
    I don't think such a beast can exist: C++ is complex to parse, and requires optimizations. Any C++11 compiler has to be complex and optimizing and its standard library requires many features from the OS so cannot be tiny. See also this explanation Commented Aug 20, 2018 at 5:59
  • if you don't care about performance and want to compile the code on any computer without a compiler then you should use a scripting language like powershell, VBS, Jscript or batch. Otherwise just compile the code and distribute the binary
    – phuclv
    Commented Aug 20, 2018 at 6:55
  • 1
    "you dont have to compile it for every pc you put it on" = both the compiler and your code will need to be re-compiled for each new architecture. You can't get round that, unless you compile your C++ down to byte code and have a different byte code interpreter for every architecture
    – Mawg
    Commented Aug 20, 2018 at 7:56

2 Answers 2


I used the compiler from DigitalMars on Windows to compile from my editor. Although I am not sure it is all you are looking for, I remember it to be about 10MB. There may be additional downloads needed, since I used it for C only.

Here is the downloads page: https://digitalmars.com/download/freecompiler.html

  • I am not sure it can be installed at an arbitrary place Commented Aug 20, 2018 at 6:44
  • 2
    @BasileStarynkevitch I just unzipped it in C:\dm and put the directory with ‘dmc.exe’ on my path.
    – user39976
    Commented Aug 20, 2018 at 6:48

not sure if it's exactly small but there is TDM gcc that I have used successfully in the past. Zipped, it's 20 MB in size.

TDM-GCC is a compiler suite for Windows.

It combines the most recent stable release of the GCC toolset, a few patches for Windows-friendliness, and the free and open-source MinGW or MinGW-w64 runtime APIs to create an open-source alternative to Microsoft's compiler and platform SDK

There's an installer, but it also comes as .zip archives. It's "portable". Unzip, set the paths, and go.

It's gcc based so very widely spread standard.

  • Yes and it can be considered as "official" Installer for mingw-w64 on windows because the same guy maintains the linux repos of mingw-w64 too.
    – frakod
    Commented Jun 27, 2021 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.