GCJ with native structs

Bryce McKinlay bryce@mckinlay.net.nz
Mon Dec 8 21:08:00 GMT 2003


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.




More information about the Java mailing list