[cfe-dev] linker error with ASTConsumer
John McCall
rjmccall at apple.com
Mon Jan 31 11:32:13 PST 2011
On Jan 31, 2011, at 11:19 AM, jignesh vasoya wrote:
> when i am trying to compile given source it gives linker error :
>
> tutorial4.o:(.rodata._ZTIN5clang13MyASTConsumerE[typeinfo for clang::MyASTConsumer]+0x10): undefined reference to `typeinfo for clang::ASTConsumer'
> collect2: ld returned 1 exit status
> make: *** [tutorial4] Error 1
>
>
> Source code is: all necessary header files are included and there is no syntax error in this source code, required libraries are also specified in make file.
LLVM and Clang are compiled with -fno-rtti by default. You have three options:
- You can re-enable RTTI when you build LLVM and Clang.
- If you don't use RTTI in your project, you can just compile with -fno-rtti.
- You can compile every file that emits the vtable for this class with -fno-rtti. The easier way to do this is to anchor the vtable to a particular file and compile that with -fno-rtti.
John.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110131/83215a1c/attachment.html>
More information about the cfe-dev
mailing list