Include Z3 in a C++ project

◇◆丶佛笑我妖孽 提交于 2019-12-11 13:52:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!