Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Calling Perl from C - Problem with DynaLoader
Hi, 

I am trying to call Perl from C. I hit a problem when I try to load dynamic librarires.
  I have taken the following code from the PerlEmbed documentation (http://www.per
ldoc.com/perl.../perlembed.html) but cannot get it to compile.

I am trying to play with parameters to the gcc compiler but so far with no l
uck.

Here are the contents of my c file:

#include <EXTERN.h>
#include <perl.h>

static void xs_init (pTHX);

EXTERN_C void boot_DynaLoader (pTHX_ CV* cv);
EXTERN_C void boot_Socket (pTHX_ CV* cv);


EXTERN_C void
xs_init(pTHX)
{
char *file = __FILE__;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("Socket::bootstrap", boot_Socket, file);
}  



static PerlInterpreter *my_perl;

int main(int argc, char **argv, char **env)
{
char *my_argv[] = { "", "sxiconn.pl" };  

my_perl = perl_alloc();
perl_construct(my_perl);


printf ("Loading Perl <sxiconn.pl> file...\n") ;
perl_parse(my_perl, xs_init, argc, my_argv, NULL); 
printf ("Loaded Perl file.\n") ;

perl_destruct(my_perl);
perl_free(my_perl);
}  


Any suggestions?


Report this thread to moderator Post Follow-up to this message
Old Post
Paul Boyce
09-23-04 01:55 PM


Re: Calling Perl from C - Problem with DynaLoader
In article < F276D1444D9E2C4DB540D48F1F8B2C1F0157F6C0
@rtmail1.rtel.com>,
Paul.Boyce@rtel.com (Paul Boyce) writes:
>I am trying to call Perl from C. I hit a problem when I try to load
>dynamic librarires.

This is not a beginner level question.  You'll find more experts who
have the knowledge to answer it over on comp.lang.perl.misc.  At least,
there are many such people posting there who I have never seen posting
here.

--
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/

Report this thread to moderator Post Follow-up to this message
Old Post
Peter Scott
09-23-04 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:22 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.