在C ++项目中包含Z3 [英] Include Z3 in a C++ project

查看:150
本文介绍了在C ++项目中包含Z3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在llvm项目(从其示例项目复制的文件目录)中使用Z3.我现在所做的只是简单地包含z3 ++.h,而没有在源文件中添加任何其他代码并希望通过编译.但是我不知道如何处理makefile以使其工作.我尝试了几次,它报告了诸如禁用异常处理,使用-fexceptions启用"之类的错误以及其他链接错误.有人可以给我提示如何更改Makefile使其起作用吗?

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?

推荐答案

我不清楚正在修改哪个makefile,我只能说Z3. C ++示例没有自己的makefile,但在z3/build/Makefile中有目标,称为cpp_example $(EXE_EXT)和_ex_cpp_example.这些目标中的命令所使用的变量位于z3/build/config.mk中,如果需要-fexceptions,则可以在此处将其添加到CXXFLAGS变量中.

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.

大约,该示例应该需要-I/path/to/z3++.h -I/path/to/z3.h -L/path/to/libz3.so和-lz3,并且在运行Z3时需要libz3的路径.so必须位于PATH(Windows),LD_LIBRARY_PATH(Linux)或DYLD_LIBRARY_PATH(OSX)中.

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).

这篇关于在C ++项目中包含Z3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆