$ cat Kbh.xs #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include "send_string.h" MODULE = Kbh PACKAGE = Kbh PROTOTYPES: DISABLE void send_string(s) const char * s TYPEMAP: < void send_string(const char* str) { puts(str); } $ cat send_string.h void send_string(const char* str); $ cat lib/Kbh.pm package Kbh; our $VERSION = '0.01'; require XSLoader; XSLoader::load('Kbh', $VERSION); 1; $ cat Makefile.pl use ExtUtils::MakeMaker; WriteMakefile ( NAME=>'Kbh', VERSION_FROM =>'lib/Kbh.pm', OBJECT => 'Kbh.o send_string.o', ) $ perl Makefile.pl Generating a Unix-style Makefile Writing Makefile for Kbh Writing MYMETA.yml and MYMETA.json $ make cp Makefile.pl blib/lib/Makefile.pl cp lib/Kbh.pm blib/lib/Kbh.pm Running Mkbootstrap for Kbh () chmod 644 "Kbh.bs" "/usr/bin/perl.exe" "/usr/lib/perl5/5.22/ExtUtils/xsubpp" -typemap "/usr/lib/perl5/5.22/ExtUtils/typemap" Kbh.xs > Kbh.xsc && mv Kbh.xsc Kbh.c gcc -c -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.4-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.4=/usr/src/debug/perl-5.22.4-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" Kbh.c gcc -c -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.4-1 -fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.4=/usr/src/debug/perl-5.22.4-1 -fwrapv -fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" send_string.c rm -f blib/arch/auto/Kbh/Kbh.dll g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong Kbh.o send_string.o -o blib/arch/auto/Kbh/Kbh.dll \ /usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE/cygperl5_22.dll \ chmod 755 blib/arch/auto/Kbh/Kbh.dll "/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Kbh.bs blib/arch/auto/Kbh/Kbh.bs 644