Note, the lib directory as well as the perl.dll has been copied over to VS output directory from the previously created and installed perl interpreter

That seems a rather odd thing to do. Ensuring that the directory that houses the perl.dll is in the PATH is normally all that's needed.

Is VS2017 community edition suitable for building a 64bit embedded perl interpreter?

I would expect so, but I haven't tested.

If so, are there some recommendations on how to do this?

Yes, perlembed.

If not, might using mingw toolchain create an embedded perl...

Yes.

However, I too strike issues with your C code. Not sure where you got it from, but the current perlembed docs present it slightly differently.
Here's what I get (with mingw built perl-5.30.0) when I use the C code provided by the perl-5.30.0 perlembed docs:
C:\_32\pscrpt\embed>type embed.c #include <EXTERN.h> #include <perl.h> static PerlInterpreter *my_perl; int main(int argc, char **argv, char **env) { PERL_SYS_INIT3(&argc,&argv,&env); my_perl = perl_alloc(); perl_construct(my_perl); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_parse(my_perl, NULL, argc, argv, (char **)NULL); perl_run(my_perl); perl_destruct(my_perl); perl_free(my_perl); PERL_SYS_TERM(); exit(EXIT_SUCCESS); } C:\_32\pscrpt\embed>perl -MExtUtils::Embed -e ccopts -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPER +L_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANS +I_STDIO -fwrapv -fno-strict-aliasing -mms-bitfields -I"C:\_64\perl53 +0_810\lib\CORE" C:\_32\pscrpt\embed>perl -MExtUtils::Embed -e ldopts -s -L"C:\_64\perl530_810\lib\CORE" -L"C:\_64\gcc-mingw-810\mingw64\l +ib" "C:\_64\perl530_810\lib\CORE\libperl530.a" "C:\_64\gcc-mingw-810 +\mingw64\x86_64-w64-mingw32\lib\libmoldname.a" "C:\_64\gcc-mingw-810\ +mingw64\x86_64-w64-mingw32\lib\libkernel32.a" "C:\_64\gcc-mingw-810\m +ingw64\x86_64-w64-mingw32\lib\libuser32.a" "C:\_64\gcc-mingw-810\ming +w64\x86_64-w64-mingw32\lib\libgdi32.a" "C:\_64\gcc-mingw-810\mingw64\ +x86_64-w64-mingw32\lib\libwinspool.a" "C:\_64\gcc-mingw-810\mingw64\x +86_64-w64-mingw32\lib\libcomdlg32.a" "C:\_64\gcc-mingw-810\mingw64\x8 +6_64-w64-mingw32\lib\libadvapi32.a" "C:\_64\gcc-mingw-810\mingw64\x86 +_64-w64-mingw32\lib\libshell32.a" "C:\_64\gcc-mingw-810\mingw64\x86_6 +4-w64-mingw32\lib\libole32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w6 +4-mingw32\lib\liboleaut32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64 +-mingw32\lib\libnetapi32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64- +mingw32\lib\libuuid.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw +32\lib\libws2_32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\ +lib\libmpr.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\li +bwinmm.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libver +sion.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libodbc3 +2.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libodbccp32 +.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libcomctl32. +a"
Now create the executable (embed.exe):
C:\_32\pscrpt\embed>gcc -o embed.exe embed.c -s -O2 -DWIN32 -DWIN64 -D +CONSERVATIVE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_ +IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-stric +t-aliasing -mms-bitfields -I"C:\_64\perl530_810\lib\CORE" -s -L"C: +\_64\perl530_810\lib\CORE" -L"C:\_64\gcc-mingw-810\mingw64\lib" "C:\ +_64\perl530_810\lib\CORE\libperl530.a" "C:\_64\gcc-mingw-810\mingw64\ +x86_64-w64-mingw32\lib\libmoldname.a" "C:\_64\gcc-mingw-810\mingw64\x +86_64-w64-mingw32\lib\libkernel32.a" "C:\_64\gcc-mingw-810\mingw64\x8 +6_64-w64-mingw32\lib\libuser32.a" "C:\_64\gcc-mingw-810\mingw64\x86_6 +4-w64-mingw32\lib\libgdi32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w6 +4-mingw32\lib\libwinspool.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64 +-mingw32\lib\libcomdlg32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64- +mingw32\lib\libadvapi32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-m +ingw32\lib\libshell32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-min +gw32\lib\libole32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32 +\lib\liboleaut32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\ +lib\libnetapi32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\l +ib\libuuid.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\li +bws2_32.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libmp +r.a" "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libwinmm.a" + "C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libversion.a" " +C:\_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libodbc32.a" "C:\ +_64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\_ +64\gcc-mingw-810\mingw64\x86_64-w64-mingw32\lib\libcomctl32.a"
Now test it:
C:\_32\pscrpt\embed>embed -le "print 'hello';" hello C:\_32\pscrpt\embed>type hello.pl use strict; use warnings; print "hello\n"; C:\_32\pscrpt\embed>embed hello.pl hello
So it all seems to be working as advertised once your C code is modified correctly.

Cheers,
Rob

In reply to Re: Embedded perl on windows x64 by syphilis
in thread Embedded perl on windows x64 by ekopalypse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.