Dear all,
I would like to ask would it be possible to generate executable from perl scripts that
uses Inline::C?
I used to be able to generate executables from 'normal' perl scripts (those without
any Inline C codes) by using the command "perlcc -o hello hello.pl". (I'm using Perl
v5.8.0, Inline 0.44 under linux )
However I have no idea on how it could be done to perl scripts that have Inline C
codes. (Could this be done actually?)
I've tried the following commands (attempting to generate an executable and then run
it) for the perl script below (with is taken from one of the examples in the Inline C
Recipes):
> perl myperl.pl
> perlcc -o myperl myperl.pl
> ./myperl
It just failed and gives the following error message:
--------------------------------------------------------------------------------
No source code in DATA section for Inline 'C' section.
at /opt/Perl/lib/perl5/5.8.0/i686-linux/Socket.pm line 0
INIT failed--call queue aborted.
---------------------------------------------------------------------------------
I've tried some subject searches in this mailing list though, but I found nothing.
I've also been reading all around for some kind of instructions on how this could
probably been done in the Inline C's Cookbook, FAQs and pods etc, but I seem unable
to find anything related. (I remember I saw something about creating a binary
distribution for Perl modules, but not Perl scripts).
I know that this question may sound trivial, but I've been struggling with it for a
few days but still without any success.
Any help or pointers to the problem will be much appreciated. Thanks.
Regards,
cmaster
==================================================================
## this is the source code for myperl.pl ##
use Inline C;
c_func_1('This is the first line');
c_func_2('This is the second line');
sub perl_sub_1 {
print map "$_\n", @_;
}
__DATA__
__C__
void c_func_1(SV* text) {
c_func_2(text);
}
void c_func_2(SV* text) {
Inline_Stack_Vars;
Inline_Stack_Push(newSVpvf("Plus an extra line"));
Inline_Stack_Done;
perl_call_pv("main::perl_sub_1", 0);
Inline_Stack_Void;
}
====================================================================
---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing