----- Original Message ----- 
From: "Alexandru Palade" <[EMAIL PROTECTED]>

>
> Like I said I've already converted my module to Inline::C and I've
> made it work, as an Inline based distribution and as a normal CPAN
> distribution in exactly the way you said.

When you convert it to a format that can be built with Inline::C, do you
then find that it can also be built using Inline::CPP ?
I mentioned earlier the Math::Simple demo that ships with the Inline-0.44
source. I can find no difficulty in building it with Inline::CPP, though I'm
not so sure that proves anything useful :-)

>
> I don't plan on wasting anyone's time, I've already found the
> workaround solution (converted everything to Inline::C and it works
> like a charm). But if anyone is into problem solving perhaps you can
> find out why the I can't build the Inline::CPP one. I must say, I'm
> stumped.
>

If you can provide an example '.pm' file (that demonstrates the problem)
that we can run and see for ourselves then I'll have a play (and perhaps
others will, too).

I've just noticed that in one of your earlier posts you had:

#package ChmFile #commented out, not needed because Inline::CPP creates
                                    #the namespace automatically

our $VERSION = '0.01';

use Inline (
    C => Config => LIBS => '-lchm',
    VERSION => '0.01',
    NAME => __PACKAGE__,
    CLEAN_AFTER_BUILD => 0
   );
use Inline 'CPP';

__DATA__
__CPP__
.
.

Does it make any difference if that becomes:

package ChmFile;
$VERSION = '0.01';

use Inline (
    C => Config => LIBS => '-lchm',
    CLEAN_AFTER_BUILD => 0
   );
use Inline CPP => 'DATA',
      VERSION => '0.01',
      NAME => 'ChmFile';

__DATA__
__CPP__

That's more in keeping with the way (the demo) Simple.pm is laid out.

I'll go one step further - but please bear in mind that I don't know C++ :
Amend Simple.pm so it looks like:
-----------------------------------
package Math::Simple;
$VERSION = '1.23';

use Inline CPP => 'DATA',
VERSION => '1.23',
NAME => 'Math::Simple';

1;

__DATA__
__CPP__

class Foo {
public:
Foo() {}
~Foo() {}
static int get_thing() { return s_thing; }
private:
static int s_thing;
};

int Foo::s_thing = 10;
---------------------------------

I pinched the C++ code from one of the Inline::CPP test scripts.
And amend the Math::Simple test.pl so that it looks like:

---------------------------------
use strict;
use Test;
use Math::Simple;

BEGIN {
plan(tests => 1);
}

ok(Math::Simple::Foo->new->get_thing, 10);
----------------------------------

When I now build Math::Simple with Inline::CPP it still builds, tests and
runs fine. Does that help ?

Cheers,
Rob

Reply via email to