[LLVMdev] Problems with class inheritance in LLVM

James Courtier-Dutton james.dutton at gmail.com
Sun Aug 25 07:55:51 PDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130825/0b873f98/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mem.cpp
Type: text/x-c++src
Size: 876 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130825/0b873f98/attachment.cpp>


More information about the llvm-dev mailing list