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]

Call non-compil class...


reHello,

I read, somewhere but I don't remenber where, a class which is compile with gcj can call a non compiling class. I try to do this but I have some errors.

$ gcj -C test2.java
$ gcjh test2
$ gcj -c test2.java -o test2.o
$ gcj --shared -o libtest2.so test2.o
$ g++ -o test2 testcc2.cc -l test2 -L .

./libtest2.so: undefined reference to `test2bis::test2bis[in-charge]()'
./libtest2.so: undefined reference to `test2bis::class$'
collect2: ld returned 1 exit status

Version :
  gcj   : 3.3.2
  g++  :  3.3.2
  Linux(debian) Testing

So any body have an idea ?

Thank
Etienne
class test2{
	public void popo(){
		System.out.println("test2.java --> begin");
		test2bis t2 = new test2bis();
		t2.titi();
		System.out.println("test2.java --> end");
	}
}
public class test2bis{
	public test2bis(){
		System.out.println("aa");
	}

	public void titi(){
		System.out.println("ee");
	}
}
#include <iostream>
#include <gcj/cni.h>

#include "test2.h"

using namespace std;

int main(void){
	// Init
	JvCreateJavaVM(NULL);
	JvAttachCurrentThread(NULL,NULL);

	// Test
	test2 *t = new test2();
	JvInitClass(t -> getClass());

	t -> popo();

	// fin
	JvDetachCurrentThread();
	
	return 0;
}

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