问题
I want to use Z3 in a llvm project(file directory copied from its sample project). What I did now is just simply include z3++.h without adding any other code in the source file and want to pass the compilation. But I don't know how to deal with modifying makefile to make it work. I tried a few times it reports error like "exception handling disabled, use -fexceptions to enable" and other linking errors. Can someone give me a hint on how to change the makefile to make it work?
回答1:
It's not clear to me which makefile is being modified, I can only speak for Z3. The c++ example doesn't have its own makefile, but it has targets in z3/build/Makefile called cpp_example$(EXE_EXT) and _ex_cpp_example. The variables used by the commands in these targets are in z3/build/config.mk and if -fexceptions is needed, it can be added to the CXXFLAGS variable there.
Roughly, the example should need -I /path/to/z3++.h -I /path/to/z3.h -L /path/to/libz3.so and -lz3 and when running Z3 the path to libz3.so needs to be in PATH (Windows), LD_LIBRARY_PATH (Linux), or DYLD_LIBRARY_PATH (OSX).
来源:https://stackoverflow.com/questions/24025779/include-z3-in-a-c-project