Problems with class inheritance in LLVM

Hi,

I have a simple program example attached.

All it does is try to derive a class from llvm::MemoryObject.

Can anyone tell me why this fails to compile with this error message:
clang -DHAVE_CONFIG_H -I. -I…/src -I…/include -I…/test -I/usr/include/llvm-c-3.2 -I/usr/include/llvm-3.2 -O0 -g3 -Wall -O0 -Wall -g3 -MT mem.o -MD -MP -MF .deps/mem.Tpo -c -o mem.o mem.cpp
mv -f .deps/mem.Tpo .deps/mem.Po
/bin/bash …/libtool --tag=CXX --mode=link clang -I…/test -I/usr/include/llvm-c-3.2 -I/usr/include/llvm-3.2 -O0 -g3 -Wall -O0 -Wall -g3 -export-dynamic -module -avoid-version -O0 -Wall -o mem mem.o -L/usr/local/lib/beauty -lz -ldl -lLLVM-3.2 -L/usr/lib/llvm-3.2/lib -lstdc++
libtool: link: clang -I…/test -I/usr/include/llvm-c-3.2 -I/usr/include/llvm-3.2 -O0 -g3 -Wall -O0 -Wall -g3 -O0 -Wall -o mem mem.o -Wl,–export-dynamic -L/usr/local/lib/beauty -lz -ldl -lLLVM-3.2 -L/usr/lib/llvm-3.2/lib -lstdc++
mem.o:(.rodata+0x90): undefined reference to `typeinfo for llvm::MemoryObject’
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mem] Error 1

Will I have to rebuild llvm with rtti enabled, or is there some other fix I can do with standard llvm 3.2?

Kind Regards

James

mem.cpp (876 Bytes)

Hi James,

Will I have to rebuild llvm with rtti enabled, or is there some other fix I
can do with standard llvm 3.2?

Either that or compile your code with -fno-rtti as well, I believe.
Getting the incomplete RTTI that would come from forcing the issue
sounds like a recipe for disaster.

Cheers.

Tim.

You either need to rebuild llvm with rtti, or build your code with -fno-rtti