Installing the Chilkat Perl Module on Windows

Step-by-step instructions for adding the Chilkat module to a Windows Perl installation.

Which Perl do these instructions cover? Strawberry Perl 5.18 and later.
Good to know before you start
  • The module is prebuilt. chilkat.dll is already compiled, so the build step just copies chilkat.pm and chilkat.dll into your Perl's site/lib — there is no C compiler step for Chilkat itself.
  • Match the Perl version exactly. A module built for one Perl version (e.g. 5.40) will not load under a different one (e.g. 5.38). The major.minor must match what perl -version reports; a patch-level difference (5.40.x) is fine.
  • Use the same Perl to install and to run. If several Perls are installed, build and install with the same perl you'll run your scripts with — whichever is first on your PATH.
  • Import is lowercase: use chilkat; (not Chilkat).
  • Use Strawberry Perl. This is a MinGW build, and the runtime DLLs chilkat.dll depends on are supplied by Strawberry Perl.
  1. Download

    Get the Windows build from the Chilkat Windows Perl Downloads. The download is a .zip for 64-bit (x86_64) Perl.

  2. What's in the download

    Unzip the archive to any directory. It contains:

    chilkat-perl-<version>-x86_64-mingw32/
    ├─ lib/
    │   ├─ chilkat.dll          the compiled Chilkat module
    │   └─ chilkat.pm           the Perl module
    ├─ Makefile.PL              build script (ExtUtils::MakeMaker)
    ├─ MANIFEST
    ├─ META.yml
    ├─ test.pl                  a short test / unlock example
    ├─ license.pdf
    ├─ pcre2-license.pdf
    └─ quickjs-license.pdf
  3. Verify your Perl version and architecture

    The download must match your installed Perl version (5.18, 5.20, …, 5.40) and be 64-bit. Check with:

    perl -version
  4. Build and install

    In the unzipped directory, from a Command Prompt or PowerShell window, run:

    perl Makefile.PL
    gmake
    gmake install

    Recent Strawberry Perl includes gmake. On older Strawberry (5.24 and earlier) the build tool is dmake instead:

    perl Makefile.PL
    dmake
    dmake install
  5. Verify the installation

    Run the included test.pl, or this short script, which unlocks Chilkat in 30-day trial mode and prints the version:

    use chilkat();
    
    my $glob = new chilkat::CkGlobal();
    my $success = $glob->UnlockBundle("Anything for 30-day trial");
    if ($success != 1) {
        print $glob->lastErrorText() . "\n";
        exit;
    }
    
    print "Version: " . $glob->version() . "\n";

    If it prints the Chilkat version, the module is installed correctly.


Troubleshooting

“gmake” (or “dmake”) is not recognized

The build tool isn't on your PATH. The simplest fix:

  1. Download a portable Strawberry Perl .zip from strawberryperl.com/releases.html and unzip it to any directory (for example C:\Perl\strawberry-perl-portable).
  2. Add both the c\bin and perl\bin directories to your Windows PATH environment variable — for example C:\Perl\strawberry-perl-portable\c\bin and C:\Perl\strawberry-perl-portable\perl\bin.
  3. Open a new Command Prompt so it picks up the updated PATH. The build tool (gmake, or dmake on older Strawberry) should now be available.

“Can't load chilkat.dll” or a version/bootstrap mismatch

The module was built for a different Perl version. Download the build whose version matches perl -version (the major.minor must match; a 5.40.x patch difference is fine).

Bitness mismatch

A 64-bit Perl cannot load a 32-bit module, or vice-versa. The current download is 64-bit, so your Perl must be 64-bit as well.

“The specified module could not be found” when loading chilkat.dll

A runtime dependency is missing — usually because the script isn't running under Strawberry Perl, which supplies the MinGW runtime DLLs that chilkat.dll needs. Use a Strawberry Perl installation.

“Permission denied” during gmake install

The installer can't write to Perl's site/lib. This happens when Perl is in a protected location such as C:\Program Files. Run the Command Prompt as Administrator, or use a portable Strawberry Perl in a writable directory.

“Can't locate chilkat.pm in @INC”

The module was installed into a different Perl than the one running your script. Build, install, and run with the same perl — check which one is first on your PATH.

Tip Most of these come down to two things: the Chilkat build must match your Perl's version and bitness, and the same Strawberry Perl must be used to install and to run.