SVF-example icon indicating copy to clipboard operation
SVF-example copied to clipboard

Error happens when compiling SVF-example

Open for-just-we opened this issue 2 years ago • 2 comments

when I compile SVF-example in CLion, an error occured, The error message is

/home/xxx/xxx/xxx/SVF-2.2/Release-build/lib/libSvf.a(LLVMModule.cpp.o):在函数‘SVF::LLVMModuleSet::loadModules(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&)’中:
LLVMModule.cpp:(.text+0xfbe):对‘llvm::parseIRFile(llvm::StringRef, llvm::SMDiagnostic&, llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (llvm::StringRef)>)’未定义的引用

LLVM version I use is 12.0.0 SVF version I use is SVF-2.2 z3 version I use is 4.8.8

How could I fix this?

for-just-we avatar Mar 24 '22 04:03 for-just-we

Please use llvm 13 and try again.

guanqin-123 avatar Mar 24 '22 04:03 guanqin-123

It actually did not work, is it because I build SVF-2.2 on top of llvm 12.0.0?

Some part of error message is

/home/xxx/xxx/xxx/SVF-2.2/include/Graphs/GraphPrinter.h:63:74: error: no member named 'F_None' in namespace 'llvm::sys::fs'
        llvm::ToolOutputFile F(Filename.c_str(), ErrInfo, llvm::sys::fs::F_None);
                                                          ~~~~~~~~~~~~~~~^
/home/xxx/xxx/xxx/SVF-2.2/include/Graphs/GraphPrinter.h:89:23: error: no template named 'GraphTraits' in namespace 'llvm'
        typedef llvm::GraphTraits<GraphType> GTraits;
                ~~~~~~^
/home/xxx/xxx/xxx/SVF-2.2/include/Graphs/GraphPrinter.h:91:26: error: 'GTraits' (aka 'int') is not a class, namespace, or enumeration
        typedef typename GTraits::NodeRef NodeRef;

for-just-we avatar Mar 24 '22 07:03 for-just-we