Installing the Chilkat Perl Module on Windows

The quickest way to add the Chilkat module to a Windows Perl installation is the one-line installer. The manual procedure below it is for machines without internet access, or if you prefer to install from a downloaded package.

Which Perl do these instructions cover? Strawberry Perl 5.30 and later, 64-bit (x86_64). The module is a MinGW build, and the runtime DLLs it depends on are supplied by Strawberry Perl.

Install with one command

The install-perl script reads your Perl's version and architecture from the perl that runs it, downloads the matching prebuilt module, and copies chilkat.pm and chilkat.dll into that perl's site library. No gmake, dmake, or compiler is involved, and because the perl that runs the script is the perl the module goes into, the version always matches. In PowerShell or a Command Prompt:

curl.exe -fsSL https://chilkatdownload.com/perl/install-perl | perl -

Write curl.exe, not curl: in PowerShell, curl is an alias for Invoke-WebRequest. curl.exe is included with Windows 10 and later. Equivalently, download the script first and run it:

curl.exe -fsSLo install-perl https://chilkatdownload.com/perl/install-perl
perl install-perl
Administrator prompt: usually not required The installer writes into Strawberry's site\lib, which is writable by you for a normal C:\Strawberry install. If Strawberry lives somewhere protected (for example under C:\Program Files), the script says it cannot write there: either re-run from an Administrator PowerShell, or add --local to install under your user profile.
Using cpanm? The module is also available as a CPAN distribution, from Chilkat's own repository rather than from CPAN itself, so tell cpanm where to look:
cpanm --mirror https://chilkatdownload.com/cpan --mirror-only Chilkat
It fetches the same prebuilt package at configure time and installs it through MakeMaker, so cpanm is included with Strawberry Perl; cpanm --uninstall Chilkat removes it. A specific release can be installed from its URL, cpanm https://chilkatdownload.com/cpan/authors/id/C/CH/CHILKAT/Chilkat-<version>.tar.gz.

Other options: --dry-run shows what would be detected and installed without changing anything; --from <file> installs from an already-downloaded .zip (offline machines); --version 11.6.0 selects a particular Chilkat release. The script finishes by loading the module in a fresh perl and printing the Chilkat version, so OK: 'use chilkat' loads means you are done.


Manual install from a downloaded package

For machines without internet access, or if you prefer to download the package yourself. (With the package downloaded, perl install-perl --from chilkat-perl-<version>-x86_64-mingw32.zip also works in place of step 4.)

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.30, 5.32, …, 5.42) 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

This only concerns the manual procedure — the one-line installer needs no build tool at all. Otherwise, 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.