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]

RE: CNI problem on MS Windows (GCC 3.4)



> -----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();
       
       
}



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