Error with z3.dll

2019-06-14 17:21发布

I try to use Z3 Prover for a university project in C# but when I start to create a Context Object I get this Error:

System.DllNotFoundException: Die DLL "z3.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden.

   bei Microsoft.Z3.Native.LIB.Z3_del_context(IntPtr a0)

   bei Microsoft.Z3.Context.Finalize()

   bei Microsoft.Z3.Native.LIB.Z3_del_context(IntPtr a0)

   bei Microsoft.Z3.Context.Finalize() 

Is here anyone, who knows a solution?

Thankyou!

标签: c# dll z3
1条回答
The star\"
2楼-- · 2019-06-14 17:53

To use Z3 in .NET projects you need to have a reference to Microsoft.Z3.dll, which has a (native) dependency on libz3.dll. So, both DLLs must be accessible at runtime; e.g., by putting the directory that contains them into your PATH environment variable.

Also, make sure that the proper version is available, i.e., for 32-bit programs you have to use 32-bit DLLs, otherwise you will get error messages that don't help at all (e.g. it will simply report "can't load DLL").

查看更多
登录 后发表回答