Hello,
I'm looking for some advice on how to build an embedded perl interpreter on win7 x64
What I did so far is, cloned the perl github repo and built, tested and installed perl
by doing the following in the win32 directory within a x64 Native Tools Command Prompt for VS 2017
- nmake CCTYPE=MSVC141
- nmake CCTYPE=MSVC141 test
- nmake CCTYPE=MSVC141 INST_DRV=D: install
- so far so good, got some interpreter installed in d:\perl which seems to do what it should do.
Now, when trying to build an embedded perl with the same compiler VS2017 community and using the minimal sample
#include "pch.h"
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl;
int main(int argc, char **argv, char **env)
{
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl, NULL, argc, argv, (char **)NULL);
perl_run(my_perl);
perl_destruct(my_perl);
perl_free(my_perl);
}
it builds the exe but crashes on perl_parse api function when executing it like this
embeddedperl test.pl.
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.
It looks like the issue is that it is looking for a path or perl module called MSWin32-x64-multi-thread like ...\EmbeddedPerl\x64\Debug\lib\MSWin32-x64-multi-thread. (revealed by procmon) but this hasn't been created.
As I'm neither an experienced perl user nor c/c++ programmer,
it is most likely that the issue raised from something stupid I did.
I tried it with perl 5.30 as well as with the bleed branch from github but the result was the same.
Similar code was working on linux ubuntu 19.04.
Questions:
- Is VS2017 community edition suitable for building a 64bit embedded perl interpreter?
- If so, are there some recommendations on how to do this?
- If not, might using mingw toolchain create an embedded perl and if so,
are there some known pitfalls I could fall into?
Thank you
Eko
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.