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: GCJ with native structs


On Dec 9, 2003, at 7:57 AM, Stanley Brown wrote:

I compile the C++ code:
g++ -c Test.cc -o natTest.cc

Now build:
gcj --main=Test Test.java natTest.o

Heres the error I get:
natTest.o(.text+0xe):Test.cc: undefined reference to `operator new(unsigned)'
natTest.o(.rdata$_ZTI4Test+0x0):Test.cc: undefined reference to `vtable for __cx
xabiv1::__class_type_info'


Do I need to add something for linking?

The "gcj" command doesn't link the C++ runtime libraries by default, which you'll need to do a non-java "new". Try adding -lsupc++.


Regards

Bryce.



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