use strict; use warnings; use Inline 'CPP'; use Inline CPP => Config => INC => '/I C:\\some\\tools\\' => LIBS => '/libpath:"C:\\some\\tools\\bin"' => LIBS => 'important.lib' ; my $n = ask_important_lib('question'); print $n; __END__ __CPP__ #include "important.h" int ask_important_lib(char* question) { SOMECLASS var(question); if( var.errorstatus() ) { printf("we got an error %d on question %s!\n", var.errorstatus(), question); return -1; } return 1; }