This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

native static inner class methods?



Hrm, why won't this work? (gcj-3.1)

megacz@curry$ gcj foo.cc foo.java --main=foo

/tmp/cc4vv1pE.o: In function `foo__U24_bar::foo__U24_bar()':
/home/megacz/foo.java:1: undefined reference to `foo__U24_bar::foo()'
/home/megacz/foo.java:1: undefined reference to `foo__U24_bar::foo()'
collect2: ld returned 1 exit status


--- foo.java ------------------------------------------------------------
public class foo {
    public void main(String[] s) {
        new bar().foo();
    }

    public static class bar {
        native void foo();
    }
}


--- foo.cc   ------------------------------------------------------------
#include <gcj/cni.h>
#include <stdio.h>
#include "foo.h"

void ::foo$bar::foo() {
  printf("foo!\n");
}


--- foo.h    ------------------------------------------------------------
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __foo$bar__
#define __foo$bar__

#pragma interface

#include <java/lang/Object.h>

extern "Java"
{
  class foo$bar;
};

class ::foo$bar : public ::java::lang::Object
{
public: // actually package-private
  virtual void foo ();
public:
  foo$bar ();

  static ::java::lang::Class class$;
};

#endif /* __foo$bar__ */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]