CNI problem on MS Windows (GCC 3.4)
Amir Bukhari
ufz6@rz.uni-karlsruhe.de
Sat May 21 16:48:00 GMT 2005
> -----Original Message-----
> From: tromey@redhat.com [mailto:tromey@redhat.com]
> Sent: Saturday, May 21, 2005 2:26 AM
> To: Amir Bukhari
> Cc: java@gcc.gnu.org
> Subject: Re: CNI problem on MS Windows (GCC 3.4)
>> >>>>> "Amir" == Amir Bukhari <ufz6@rz.uni-karlsruhe.de> writes:
>> Amir> I am try to learn CNI. I have just tried a very simple example:
> Amir> I compiled it like c++ test.cc -lgcj
> Amir> but I got a number of undefined reference like
>> Offhand I don't know what went wrong for you.
> How small is your example? Perhaps you could post it.
>
It is realy very simple:
#include <gcj/cni.h>
#include <java/lang/System.h>
int main(int argc, char *argv)
{
using namespace java::lang;
JvCreateJavaVM(NULL);
JvAttachCurrentThread(NULL, NULL);
String *message = JvNewStringLatin1("Hello from C++");
JvDetachCurrentThread();
}
More information about the Java
mailing list