From e741f6fb1014327ad5df264ed662cb38edcfd21a Mon Sep 17 00:00:00 2001 From: Nicolas R Date: Thu, 2 May 2019 11:30:53 -0600 Subject: [PATCH] Add Socket.so link to perlembed doc When using xs_init we need to link the binary to the .so files in order to be able to call the boot_* function. Note: not sure if ExtUtils::Embed can provide a way to get the path of the .so file --- pod/perlembed.pod | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pod/perlembed.pod b/pod/perlembed.pod index d6391f7a26f9..a527aee31a67 100644 --- a/pod/perlembed.pod +++ b/pod/perlembed.pod @@ -1069,10 +1069,15 @@ Once you have this code, slap it into the second argument of I: perl_parse(my_perl, xs_init, argc, my_argv, NULL); +To avoid the error C you would also +need to link your binary with the C file. You can use the handy +one-liner C to get +its location. Then compile: - % cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts` + % cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts` \ + `perl -MSocket -e 'print @DynaLoader::dl_shared_objects'` % interp use Socket;