[klee-dev] error: ‘klee_make_symbolic’ was not declared in this scope

Daniel Liew daniel.liew at imperial.ac.uk
Thu Apr 3 02:18:01 BST 2014


This a fundamental difference between C and C++. In C you are allowed
to call a function without a proto-type (although its bad practice
because the compiler will guess function signature and return type).
In C++ you are not allowed to do this. Include the klee.h header file
and you should be fine.

On 3 April 2014 02:14, 李永超 <lyc364 at gmail.com> wrote:
> Hi,
> When building a piece of c++ code, llvm-gcc reports following error:
> error: ‘klee_make_symbolic’ was not declared in this scope
>
> The building command is :
> llvm-gcc --emit-llvm -c -g src.cpp -o src.bc
>
> and the piece of code is:
>
> #include <iostream>
> class base {
> public:
>         int a;
>         base(int b):a(b){
>         };
>         void foo(){
>                 if(a == 1)std::cout<<"yes\n";
>                 else
>                         std::cout<<"no\n";
>         }
> };
> int main() {
>         int a;
>         klee_make_symbolic(a, sizeof(a), "a");
>         base obj(a);
>         return 0;
> }
>
> But llvm-gcc works fine to build .c files with klee_make_symbolic called.
> Does anybody have any idea about this error?
>
> Thanks,
> Yongchao.




More information about the klee-dev mailing list