Klee Error: Assertion `userMainFn && “unable to get user main“‘ failed

Problem
klee reports an error.

klee: /tmp/klee_src/tools/klee/main.cpp:1068: void createLibCWrapper(std::vector<std::unique_ptrllvm::Module >&, llvm::StringRef, llvm::StringRef): Assertion `userMainFn && “unable to get user main”’ failed.

Cause
The test code added ifdef INCLUDEMAIN, which caused the main function to be skipped and triggered klee’s assertion.

#ifdef INCLUDEMAIN
int main 
.....
.....
#endif

solve

Just comment out those two lines.

Read More: