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')

Reply via email to