Skip to main content

Error 'undifined reference to 'vtable for XXX' when cross compiling pheoneMe fearture MR4

2 replies [Last post]
alexjingsi
Offline
Joined: 2011-07-14
Points: 0

<br />
hello,
When I tried to port the phoneMe feature mr4 to linux-arm, some annoying problems occured as below:
linking ../bin/cldc_vm_g ...
../bin/libcldc_vm_g.a(_MergedSrc002.o): In function `BinaryAssemblerCommon':/home/zzh/workspace/kvm2009/cldc/src/vm/share/compiler/CompilerState.hpp:76: undefined reference to `vtable for BinaryAssemblerCommon'
../bin/libcldc_vm_g.a(_MergedSrc003.o): In function `JVMConcatenatedStream':/home/zzh/workspace/kvm2009/cldc/src/vm/share/utilities/CharacterStream.hpp:260: undefined reference to `vtable for JVMConcatenatedStream'
../bin/libcldc_vm_g.a(_MergedSrc003.o): In function `JVMUnicodeStream':/home/zzh/workspace/kvm2009/cldc/src/vm/share/utilities/CharacterStream.hpp:217: undefined reference to `vtable for JVMUnicodeStream'
../bin/libcldc_vm_g.a(_MergedSrc004.o): In function `~JVMBytecodePrintClosure':/home/zzh/workspace/kvm2009/cldc/src/vm/share/handles/Method.cpp:2959: undefined reference to `vtable for JVMBytecodePrintClosure'
../bin/libcldc_vm_g.a(_MergedSrc004.o): In function `JVMBytecodePrintClosure':/home/zzh/workspace/kvm2009/cldc/src/vm/share/utilities/BytecodePrintClosure.hpp:40: undefined reference to `vtable for JVMBytecodePrintClosure'
collect2: ld returned 1 exit status
make[2]: *** [../bin/cldc_vm_g] Error 1
make[2]: Leaving directory `/home/zzh/workspace/kvm2009/build_output_arm/cldc/linux_arm_926/target/debug'
make[1]: *** [_debug] Error 2
make[1]: Leaving directory `/home/zzh/workspace/kvm2009/cldc/build/linux_arm_926'
I use the source code of phoneme_feature-mr4-rel-src-b01-20_apr_2009, JDK version is j2sdk1.4.2_15, using gcc-3.4.3-csl-uClibc-0.9.30-softvfp(made by self), and the platform is linux-arm, using Directfb-1.2.9.
Did anyone meet with the same problems before? If so, I'd appreciate it if any valuable information is offered, thanks.
<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pavelp
Offline
Joined: 2006-09-29
Points: 0

Hi Alex,

Please try to make ConcatenatedStream, BytecodePrintClosure and UnicodeStream constructors non inline and define them in the cpp files. And see if the corresponding errors disappear.

Regards,

Pavel

alexjingsi
Offline
Joined: 2011-07-14
Points: 0

Hi Pavel,

Thanks for your quick reply, and I've tried this already, another 7 more errors like these were fixed, but these 5 errors remained too.

Fortunately, I've found the solution to this issue in a nother page in this forum, the link is below:

http://www.java.net/node/703994

It seems that compiling the phoneme mr4 in debug mode always cause this error, and it disappears in product or release mode.

However, instead of modifing the root.make, I change the command "make" to "make product" when compiling the CLDC part, and it works!

I've googled for this issue, the reason of this error may be a bug of the gcc as it says below:

http://gcc.gnu.org/faq.html#vtables

Further discussion is available below:

http://www.daniweb.com/software-development/cpp/threads/114299

Regards,

Alex