Re: Subclassing CNI classes (GCJ)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/01/15 12:57, Andreas Besting wrote:
> Hi everyone,
> 
> I have a problem subclassing CNI classes in c++. Following the examples at
> 
> https://gcc.gnu.org/onlinedocs/gcj/Mixing-with-C_002b_002b.html#Mixing-with-C_002b_002b
> 
> , I tried to subclass java::lang::Object using
> 
> class MyClass : public java::lang::Object{ ... }
> 
> The code compiles fine, however as soon as I try to instantiate the
> class with
> 
> MyClass * c = new MyClass();
> 
> I get an error:
> error: can’t find ‘class$’ in ‘MyClass’
> 
> The problem seems to be the (missing) static member
> 
> static ::java::lang::Class class$;
> 
> used in every CNI class declaration. Adding this member does not resolve
> the problem.
> 
> Any ideas?

I'd declare the class in Java, then fill in the members in C++, as needed.

Andrew.






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux