From: Doug MacEachern Date: Wed, 11 Jun 1997 00:00:00 +0000 (+1200) Subject: perlembed Win32 update X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53f52f588c078f024f21d2c6ae2b835d31ef167a;p=p5sagit%2Fp5-mst-13.2.git perlembed Win32 update --- diff --git a/pod/perlembed.pod b/pod/perlembed.pod index 79783a7..de10860 100644 --- a/pod/perlembed.pod +++ b/pod/perlembed.pod @@ -37,7 +37,7 @@ Read on... L -There's one example in each of the eight sections: +There's one example in each of the nine sections: L @@ -55,8 +55,7 @@ L L -This documentation is Unix specific; if you have information about how -to embed Perl on other platforms, please send e-mail to >. +L =head2 Compiling your C program @@ -944,6 +943,41 @@ B can also automate writing the I glue code. Consult L and L for more details. +=head1 Embedding Perl under Win32 + +At the time of this writing, there are two versions of Perl which run +under Win32. Interfacing to Activeware's Perl library is quite +different from the examples in this documentation, as significant +changes were made to the internal Perl API. However, it is possible +to embed Activeware's Perl runtime, see the Perl for Win32 FAQ: +http://www.perl.com/perl/faq/win32/Perl_for_Win32_FAQ.html + +With the "official" Perl version 5.004 or higher, all the examples +within this documentation will compile and run untouched, although, +the build process is slightly different between Unix and Win32. + +For starters, backticks don't work under the Win32 native command shell! +The ExtUtils::Embed kit on CPAN ships with a script called +B, which generates a simple makefile to build a program from +a single C source file. It can be used like so: + + C:\ExtUtils-Embed\eg> perl genmake interp.c + C:\ExtUtils-Embed\eg> nmake + C:\ExtUtils-Embed\eg> interp -e "print qq{I'm embedded in Win32!\n}" + +You may wish to use a more robust environment such as the MS Developer +stdio. In this case, to generate perlxsi.c run: + + perl -MExtUtils::Embed -e xsinit + +Create a new project, Insert -> Files into Project: perlxsi.c, perl.lib, +and your own source files, e.g. interp.c. Typically you'll find +perl.lib in B, if not, you should see the B +directory relative to C. +The studio will also need this path so it knows where to find Perl +include files. This path can be added via the Tools -> Options -> +Directories menu. Finnally, select Build -> Build interp.exe and +you're ready to go! =head1 MORAL