$ cat ./perlportable.c #include #include /* we're going to embed two interpreters */ #define SAY_HELLO "-e", "$string = $^X; $string =~ s/.*\///; $newstring = $^X ; $newstring =~ s/$string//; print $newstring;" int main(int argc, char **argv, char **env) { PerlInterpreter *one_perl; char *one_args[] = { "one_perl", SAY_HELLO }; PERL_SYS_INIT3(&argc,&argv,&env); one_perl = perl_alloc(); PERL_SET_CONTEXT(one_perl); perl_construct(one_perl); perl_parse(one_perl, NULL, 3, one_args, (char **)NULL); perl_run(one_perl); perl_destruct(one_perl); perl_free(one_perl); PERL_SYS_TERM(); } $ gcc libperl.a perlportable.c -Wl,-E -fstack-protector-strong -L/usr/local/lib -L/home/zorin-os/UPM/perl5.26/lib/5.26.0/x86_64-linux/CORE -lperl -lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/home/zorin-os/UPM/perl5.26/lib/5.26.0/x86_64-linux/CORE perlportable.c:1:20: fatal error: EXTERN.h: No such file or directory compilation terminated. bash: line 1: -fwrapv: command not found $ ./a.out syntax error at -e line 1, near "/;" Execution of -e aborted due to compilation errors.