Nim

Install

Windows:

Linux:

$ sudo apt install mingw-w64 -y
$ sudo apt install nim -y
Or
$ curl https://nim-lang.org/choosenim/init.sh -sSf | sh

Dependencies:

Nim > nimble install winim nimcrypto zippy

Compilation

Basic:

Nim > nim c program.nim

To not popup the console window:

Nim > nim c --app:gui program.nim

For the best size:

Nim > nim c -d:danger -d:strip --opt:size --passC=-flto --passL=-flto program.nim

For Windows on Linux:

$ nim c --cpu:amd64 --os:windows --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc program.nim

Add the needed relocation section to the resulting executable (from Windows):

Nim > nim c --passL:-Wl,--dynamicbase,--export-all-symbols program.nim

Tools & Packers

Last updated