Choosing the Native Chilkat "C" Go Library on Windows

Building the Chilkat Go package requires CGO, which in turn uses the MinGW gcc/g++ compilers installed on your system. There are many different MinGW compiler versions and options. Chilkat provides native library builds for many different MinGW versions and options. You should use the one that matches the MinGW compiler installed on your system. (An exact match may not be necessary. For example, an older version can be downloaded as long as the architecture (32-bit/64-bit) matches.)

If You Haven't Yet Installed a MinGW Compiler on Windows...

If you try to build the "chilkat" Go package prior to installing a MinGW compiler suite, you'll get this error:

C:\Go\src\chilkat>go build
# chilkat
exec: "gcc": executable file not found in %PATH%

How to Install a 64-bit MinGW Compiler

We're assuming you're on a 64-bit Windows system...

  • Open a browser and go to https://winlibs.com/
  • Scroll down and download a .zip archive of the latest MingW-w64 version with MSVCRT runtime. LLVM/Clang is not needed.
  • Unzip to any directory.
  • (I recommend using the Rapid Environment Editor for managing Windows environment variables, especially the PATH environment variable.)
  • Update your PATH environment variable to include the path where gcc.exe is located. For example, I installed MingW-w64 to C:\MinGW\winlibs-x86_64-mingw-10.0.0, and the directory where gcc.exe is found is C:\MinGW\winlibs-x86_64-mingw-10.0.0\mingw64\bin

You can now go back to Building the Chilkat "Go" Package and continue with Step 3.