[LLVMdev] Porting pass from llvm 3.1 to 3.4

Diogo Sampaio dnsampaio at gmail.com
Wed Jul 2 09:17:12 PDT 2014


Dear llvmers

I'm trying to port some code that was written for llvm 3.1 to 3.4.2.
I'm having two linking problems and I couldn't find the source of the
problem. Usually it is an error for a virtual method not declared. The
error starts even when changing llvm version from 3.1 to 3.2.

The current line declaring an command line option:
-----
static cl::opt<string> InputFilename(cl::Positional, cl::Required,
cl::desc("<input bitcode file>"), cl::init("-"),
cl::value_desc("filename"));

And the class declaration:
class Ids : public ModulePass {
}
-----
Gives me these linking time errors:


cd /home/sampaio/3.2/ddg/build/tools/dynamic-graph && /usr/bin/cmake
-E cmake_link_script CMakeFiles/cdag_disk.dir/link.txt --verbose=1
/usr/bin/g++-4.6       CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o  -o
cdag_disk -rdynamic -L/home/sampaio/llvm/lib
../../lib/analysis/libddg-analysis.a -lLLVMBitReader -lLLVMAsmParser
-lLLVMAnalysis -lLLVMTarget -lLLVMCore -lLLVMMC -lLLVMObject
-lLLVMSupport -ldl -lpthread -lboost_iostreams-mt
-Wl,-rpath,/home/sampaio/llvm/lib:
CMakeFiles/cdag_disk.dir/cdag_disk.cxx.o:(.data.rel.ro._ZTIN4llvm2cl15OptionValueCopyISsEE[typeinfo
for llvm::cl::OptionValueCopy<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >]+0x10): undefined
reference to `typeinfo for llvm::cl::GenericOptionValue'
../../lib/analysis/libddg-analysis.a(Ids.cxx.o):(.data.rel.ro._ZTIN3ddg3IdsE[typeinfo
for ddg::Ids]+0x10): undefined reference to `typeinfo for
llvm::ModulePass'alue'

-----
Thank you very much
-- 
Diogo Nunes Sampaio



More information about the llvm-dev mailing list