Link to C library

monnoroch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 19 06:06:48 PDT 2014


I can't link to libjvm.so.
Here's my code:

extern (C) {
	int JNI_CreateJavaVM(void ** pvm, void ** penv, void * args);
}

void main() {
	writefln("0x%x", &.JNI_CreateJavaVM);
}

Which ptints wrong stuff. When then i use it and check the
contents of **pvm is also prints wrong stuff full of zeroes, but
the result is 0(JNI_OK).

I build it with:
dmd -m64 main.d -I. -L-ljvm -debug.

Any suggestions?


More information about the Digitalmars-d-learn mailing list