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 http://mingw-w64.org/doku.php
- Click on "Downloads"
- You'll see a table of Pre-built toolchains and packages. Click on "MingW-W64-builds"
- Click on "Sourceforge" (this is the direct download link).
- You'll go to a Sourceforge web page where your download will automatically begin in 5 seconds.
- Save "mingw-w64-install.exe" to a file. Then run it.
- A dialog is shown. Choose to install:
Version: 8.1.0 Architecture: x86_64 Threads: posix Exception: seh
- If you wish, change your destination folder to C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0
- Add C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin to your PATH environment variable.
After installing the 64-bit gcc v8.1.0 posix/seh, you can download the matching Native Chilkat "C" Go Lib: MinGW-w64 GCC-8.1.0 x86_64-8.1.0-posix-seh C Static Lib
You can now go back to Building the Chilkat "Go" Package and continue with Step 3.