[cfe-dev] undefined reference to `vtable for clang::AnalysisAction'

Douglas Gregor dgregor at apple.com
Tue Jun 29 07:39:37 PDT 2010


On Jun 24, 2010, at 5:36 PM, Eric Niebler wrote:
> I really can't wait to try clang. I gave up waiting for clang to work
> under cygwin (http://llvm.org/bugs/show_bug.cgi?id=7276), so I installed
> Linux. I still can't build clang :-P and figure I must be doing
> something wrong. This is a clean-install of the latest Ubuntu. I
> followed the steps here: http://clang.llvm.org/get_started.html.
> Everything goes great right up to the very end, when it fails linking
> clang. It's not just a temporary hick-up. It did the same thing when I
> first tried this a few days ago.
> 
> Does anybody here have an idea what the problem might be?

Are you doing anything different from checking out llvm+clang then running ./configure && make ?

> llvm[4]: Linking Debug executable clang
> /home/eric/llvm/tools/clang/tools/driver/Debug/cc1_main.o: In function
> `AnalysisAction':
> /home/eric/llvm/tools/clang/tools/driver/../../include/clang/Checker/FrontendActions.h:21: undefined reference to `vtable for clang::AnalysisAction'
> collect2: ld returned 1 exit status
> make[4]: *** [/home/eric/llvm/Debug/bin/clang] Error 1
> make[4]: Leaving directory `/home/eric/llvm/tools/clang/tools/driver'
> make[3]: *** [all] Error 1
> make[3]: Leaving directory `/home/eric/llvm/tools/clang/tools'
> make[2]: *** [all] Error 1
> make[2]: Leaving directory `/home/eric/llvm/tools/clang'
> make[1]: *** [clang/.makeall] Error 2
> make[1]: Leaving directory `/home/eric/llvm/tools'
> make: *** [all] Error 1

If you run nm on llvm/Debug/lib/libclangChecker.a, do the following symbols show up?

0000000000022870 S __ZTIN5clang14AnalysisActionE
0000000000022890 S __ZTSN5clang14AnalysisActionE
0000000000022800 S __ZTVN5clang14AnalysisActionE

	- Doug



More information about the cfe-dev mailing list