On Apr 28, 12:49 pm, [EMAIL PROTECTED] (Jan Dubois) wrote:
> If you are using the mechanism from win32/Makefile, then you must make sure
> you add your extension to the list in STATIC_EXT to make sure it gets
> initialized properly.  Otherwise you need to add some code to your
> xs_init() function to define the bootstrap function in your module via
>
>     newXS("MyExt::boot_MyExt", boot_MyExt, __FILE__);
>
> and then make sure you call MyExt::boot_MyExt() manually before calling
> any function from MyExt().  The BOOT section in the XS code is responsible
> for registering all the XS functions at the Perl level.
>
> Cheers,
> -Jan

Hi Jan,

Thank you for the quick reply. I'll try to outline my scenario :-

1) Visual C++ App is called - DataDownloader.exe (with perl 5.8
persistent interpreter inside)

2) getdata.pl is a perl script that is called by the perl interpreter
residing in DataDownloader.exe.

3) DataLoader is the name of the Perl extension that I'm statically
linking (i.e. DataLoader.lib) with my DataDownloader.exe app. This has
a sub named 'DataLoader::Cache' which the getdata.pl calls.

Now in my DataDownloader.exe I have an xs_init() function that does a
    newXS("DataLoader::boot_DataLoader", boot_DataLoader, __FILE__);

But my extension still does not get registered 'properly' as my
getdata.pl script cannot see the DataLoader extension routines (i.e.
Cache()) and complains of an 'undefined subroutine'.

Are you saying I should explicitly call boot_DataLoader() in my C++
code ?
If so, then what does the newXS() in xs_init() do ?  If I do call
boot_DataLoader() manually, what arguments should I provide it with ?
I looked at the perl headers and dont know what pTHX_ is ?

Please help. My sincere regards.

Manoj.

Reply via email to