From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7671 invoked by alias); 24 Jun 2013 12:17:19 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 7577 invoked by uid 89); 24 Jun 2013 12:17:18 -0000 X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail-server.ntb.ch (HELO mail-server.ntb.ch) (146.136.1.75) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 24 Jun 2013 12:17:12 +0000 Received: from MAIL-SERVER.ntb.ch ([146.136.1.75]) by mail-server.ntb.ch ([146.136.1.75]) with mapi id 14.02.0342.003; Mon, 24 Jun 2013 14:17:09 +0200 From: Bucher Fabio To: "java@gcc.gnu.org" Subject: create an object with cni Date: Mon, 24 Jun 2013 12:17:00 -0000 Message-ID: <17B34E365AFABC468216733E4B4CC75492AD806B@mail-server.ntb.ch> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg00005.txt.bz2 Thank you, I can run this example and I put my code in there. Which is the = right namespace to use, and which Class do I have to load with the JvInitCl= ass()-method? Now the error message says: Test.cc:20:29: error: expected primary-expression before =BB)=AB token Test.cc:21:29: error: typ specification expected Test.cc:21:29: error: Java-object test is not with new allocated Test.cc:21:29: error: =BB,=AB or =BB;=AB expected Do I have to load my Java-class with the JvInitClass()-method? I think yes,= but how is it done the right way? #include #include "Java_with_CNI.h" #include #include #include int main(int argc, char *argv[]){ using namespace java::lang; //using namespace ::Java_with_CNI; try{ JvCreateJavaVM(NULL); JvAttachCurrentThread(NULL, NULL); JvInitClass(&System::class$); String *message =3D JvNewStringLatin1("Hello from C= ++"); System::out->println(message); /* Here goes my Code */ 20 JvInitClass(Java_with_CNI); 21 Java_with_CNI test =3D new Java_with_CNI::Java_with= _CNI(); test.printHello(); JvDetachCurrentThread(); }catch(Throwable *t){ System::err->println(JvNewStringLatin1("Unhandled J= ava exception:")); } //rtems_entry_point(void); //return 0; }