gcj

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

 



Hello GNU guys,

I have a question concerning GCJ, CNI and nested java classes.  The
following is my java class scenario in
which class A contains an instance of a nested class B:

Class  A
{

   B b;

        Class B
        {
                int getSize();
        }
}

In my CNI style C++ file, I  have the following code that attempts to
access b->getSize() through a, which is an instance of A



#include <A.h>     		// line number 3

A$B *tmp = (A$B*)a.getB;	// line number 180
jint size = tmp->getSize();	// line number 181




When I compile with gcj, I get the following error:
Test.cpp:181: error: invalid use of undefined type 'A$B'

As you can see, the compiler didn't have a problem with line 180 where I
got the instance b of class B.  The problem 
came when I tried to use the instance of b.  I assume this is because
there is no A$B header file.  I tried to produce the 
A$B.h file, but gcjh only produced the A.h file even when I ran 
gcjh A$B.

Any ideas?

You guys make good stuff!
Thanks!
Phil

  



[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