3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 17:15:31 +00:00

c++ example

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-10-28 10:06:02 -07:00
parent 5135eecc2d
commit be97785253
9 changed files with 87 additions and 46 deletions

10
examples/c++/README Normal file
View file

@ -0,0 +1,10 @@
Small example using the c++ bindings.
To build the example execute
make examples
in the build directory.
This command will create the executable cpp_example.
On Windows, you can just execute it.
On OSX and Linux, you must install z3 first using
sudo make install
OR update LD_LIBRARY_PATH (Linux) or DYLD_LIBRARY_PATH (OSX) with the build directory. You need that to be able to find the Z3 shared library.

View file

@ -1,24 +0,0 @@
This directory contains scripts to build the test application using
Microsoft C compiler, or g++.
1) Using Microsoft C compiler
Use 'build.cmd' to build the test application using Microsoft C
compiler.
Remark: The Microsoft C compiler (cl) must be in your path,
or you can use the Visual Studio Command Prompt.
The script 'exec.cmd' adds the bin directory to the path. So,
example.exe can find z3.dll.
2) Using gcc
You must install Z3 before running this example.
To install Z3, execute the following command in the Z3 root directory.
sudo make install
Use 'build.sh' to build the test application using g++.
It generates the executable 'example'.

View file

@ -1 +0,0 @@
cl /EHsc /I ..\..\include /I . ..\..\bin\z3.lib example.cpp

View file

@ -1 +0,0 @@
cl /W3 /EHsc /I ..\lib ..\debug\z3_dbg.lib example.cpp

View file

@ -1,9 +0,0 @@
if g++ -fopenmp -o example example.cpp -lz3; then
echo "Example was successfully compiled."
echo "To run example, execute:"
echo " ./example"
else
echo "You must install Z3 before compiling this example."
echo "To install Z3, execute the following command in the Z3 root directory."
echo " sudo make install"
fi

View file

@ -1,5 +0,0 @@
@echo off
SETLOCAL
set PATH=..\..\bin;%PATH%
example.exe
ENDLOCAL

File diff suppressed because it is too large Load diff