Hi Thoren,
Aaah! You've found a bug! Don't worry, I squashed it. You can download the
release candidate for Inline-CPP-0.23 from here:
http://ttul.org/~nwatkiss/CPAN/Inline-CPP-0.23-TRIAL1.tar.gz
Thanks for the find, and please let me know if you find any other bugs.
The more, the merrier!
Later,
Neil
On 19 Jun 2001, Thoren Johne wrote:
> hi list,
>
> i have this code using a 'static int' - it compiles fine with
> Inline::CPP - ~/_Inline/build is empty, the *.so can be found in
> ~/_Inline/lib/auto/...,
>
> but then i got this error message from perl:
>
> Can't locate object method "new" via package "Foo" (perhaps you
> forgot to load "Foo"?) at ./cpp_test1.pl line 5.
>
> my fault? different approach for static class variables available?
>
> ---------------<snip>---------------
> #!/usr/local/bin/perl
> use strict;
> use warnings;
>
> my $bar = new Foo();
> print Foo->get_count, "\n";
>
> use Inline CPP => <<'END_OF_CPP_CODE';
>
> class Foo {
> public:
> Foo(){ cout << "hello world! - " << ++fooCount << endl; }
> ~Foo(){ cout << "bye bye - " << --fooCount << endl; }
> static int get_count() { return fooCount; }
> private:
> static int fooCount;
> };
>
> int Foo::fooCount = 0;
>
> END_OF_CPP_CODE
>
> --
> # Thoren Johne - 8#X - [EMAIL PROTECTED]
> # Southern Division Classic Bikes - www.southern-division.com
> no warnings;our($Just,$another,$Perl,$Hacker)=3...7,print((map{"$$_[0] "}
> sort{$$a[1]<=>$$b[1]}map{[$_,eval"\$::$_"]}grep/^[JaPH][^t]/,%::),' 8#X')
>