I installed Z3 and was able to compile C/C++ examples as well with make examples. But when I try to compile any sample code by including "z3++.h" and using lz3 linker flag as well, I get undefined reference errors.
When I installed Z3 and compiled same code earlier, it worked. I didn't make any changes in Z3 code, but now it throws unexpected errors.
cat test.cpp
#include<z3++.h>
using namespace z3;
int main() {
context c;
expr x = c.int_const("x");
std::cout << x + 1 << "\n";
return 0;
}
g++ -c test.cpp
g++ -o test test.o -lz3
Errors: test.o: In function `z3::operator+(z3::expr const&, z3::expr const&)': test.cpp:(.text._ZN2z3plERKNS_4exprES2_[_ZN2z3plERKNS_4exprES2_]+0x203): undefined reference to `Z3_mk_re_union' test.o: In function `z3::concat(z3::expr const&, z3::expr const&)': test.cpp:(.text._ZN2z36concatERKNS_4exprES2_[_ZN2z36concatERKNS_4exprES2_]+0x76): undefined reference to `Z3_is_seq_sort' test.cpp:(.text._ZN2z36concatERKNS_4exprES2_[_ZN2z36concatERKNS_4exprES2_]+0xd3): undefined reference to `Z3_mk_seq_concat' test.cpp:(.text._ZN2z36concatERKNS_4exprES2_[_ZN2z36concatERKNS_4exprES2_]+0x11d): undefined reference to `Z3_is_re_sort' test.cpp:(.text._ZN2z36concatERKNS_4exprES2_[_ZN2z36concatERKNS_4exprES2_]+0x17a): undefined reference to `Z3_mk_re_concat' collect2: error: ld returned 1 exit status