<div dir="ltr">Most likely LLVM is built with RTTI disabled, which LLVM does by the default, and your code is built with RTTI enabled.  Make sure the RTTI settings match.  The easiest fix for you is probably to add -fno-rtti to CFLAGS.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 9:17 AM, Diogo Sampaio <span dir="ltr"><<a href="mailto:dnsampaio@gmail.com" target="_blank">dnsampaio@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear llvmers<br>
<br>
I'm trying to port some code that was written for llvm 3.1 to 3.4.2.<br>
I'm having two linking problems and I couldn't find the source of the<br>
problem. Usually it is an error for a virtual method not declared. The<br>
error starts even when changing llvm version from 3.1 to 3.2.<br>
<br>
The current line declaring an command line option:<br>
-----<br>
static cl::opt<string> InputFilename(cl::Positional, cl::Required,<br>
cl::desc("<input bitcode file>"), cl::init("-"),<br>
cl::value_desc("filename"));<br>
<br>
And the class declaration:<br>
class Ids : public ModulePass {<br>
}<br>
-----<br>
Gives me these linking time errors:<br>
<br>
<br>
cd /home/sampaio/3.2/ddg/build/tools/dynamic-graph && /usr/bin/cmake<br>
-E cmake_link_script CMakeFiles/cdag_disk.dir/link.txt --verbose=1<br>
/usr/bin/g++-4.6       CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o  -o<br>
cdag_disk -rdynamic -L/home/sampaio/llvm/lib<br>
../../lib/analysis/libddg-analysis.a -lLLVMBitReader -lLLVMAsmParser<br>
-lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMMC -lLLVMObject<br>
-lLLVMSupport -ldl -lpthread -lboost_iostreams-mt<br>
-Wl,-rpath,/home/sampaio/llvm/lib:<br>
CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o:(.data.rel.ro._ZTIN4llvm2cl15OptionValueCopyISsEE[typeinfo<br>
for llvm::cl::OptionValueCopy<std::basic_string<char,<br>
std::char_traits<char>, std::allocator<char> > >]+0x10): undefined<br>
reference to `typeinfo for llvm::cl::GenericOptionValue'<br>
../../lib/analysis/libddg-analysis.a(Ids.cxx.o):(.data.rel.ro._ZTIN3ddg3IdsE[typeinfo<br>
for ddg::Ids]+0x10): undefined reference to `typeinfo for<br>
llvm::ModulePass'alue'<br>
<br>
-----<br>
Thank you very much<br>
<span class="HOEnZb"><font color="#888888">--<br>
Diogo Nunes Sampaio<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</font></span></blockquote></div><br></div>