Getting Started with Chilkat Go on Ubuntu Linux

Verify Go is Installed

The $GOPATH environment variable should be defined, and “go” should be a command.  The following commands check $GOPATH, check the version of Go, and list the contents of the $GOPATH directory.

Download into $GOPATH/src

The Chilkat version shown here may not be the latest version of Chilkat.  Get the latest version URL from


Download the Chilkat Native C Lib

Uncompress/Untar the Chilkat Native C Lib

This creates the directory linux-x64-gcc

Set the CGO_LDFLAGS Environment Variable

You’ll probably want to put the “export CGO_LDFLAGS …” command in your .profile.

Go to $GOPATH/src/chilkat and Build Chilkat

The “go build” command will take a minute or two to complete.

Note: If you get the following error:  undefined reference to `__res_query’,  it means your system does not have

The res_query function (see ) is found within (or libresolv.a) and is linked with -lresolv.

On a 64-bit Ubuntu system, is located in /usr/lib/x86_64-linux-gnu

On your system, do the following to see if you have libresolv:

cd /usr/lib
find . -name libresolv.*


Build and Run chilkat_example1