C:\pscrpt> type free.c #include void C_free(void * ptr) { free(ptr); } C:\pscrpt> gcc -c free.c C:\pscrpt> ar rcs libC_free.a -o free.o C:\pscrpt> type try2.pl use strict; use warnings; BEGIN{ use Cwd; $m::cwd = getcwd() } use Inline C => Config => LIBS => "-L$m::cwd -lC_free"; use Inline C => <<'END_OF_C'; #define _GNU_SOURCE void foo() { char *s; asprintf(&s, "%s", "foo"); C_free(s); } END_OF_C foo(); __END__ C:\pscrpt> perl try2.pl C:\pscrpt>