Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using z3 java library in windows #1093

Closed
Edillower opened this issue Jun 21, 2017 · 2 comments
Closed

Using z3 java library in windows #1093

Edillower opened this issue Jun 21, 2017 · 2 comments

Comments

@Edillower
Copy link

Edillower commented Jun 21, 2017

I'm able to use z3 in OSX by import the jar file (com.microsoft.z3) into my eclipse java project and set its native library location to the folder that contains the libz3java.dylib file. However, problems pop up when I was trying to port my project to windows system. I added all the library files in the bin folder of z3's 4.5.0-x64-win release into the jar's native library location but still got the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: ...\libz3java.dll: Can't find dependent libraries

According to Dependency Walker, it seems that many system libraries (name starts with API-MS-WIN-CORE or EXT-MS-WIN-GDI) are missing.

I also tried adding the directory containing libz3.dll and libz3java.dll to my system's PATH instead of java.library.path as @wintersteiger suggested in issue #1064 but it didn't work.

I'm not sure what to do. Am I supposed to manually find all those missing DLL in my system and add them to the java.library.path? Thanks for your help in advance.

@wintersteiger
Copy link
Contributor

No, you're not supposed to collect all of them manually! One problem may be that the Z3 DLLs were compiled for 64-bit architectures, but your Java is 32-bit (or vice versa). In that case Java will not report a useful error message (just "can't load" and similar), so make sure all parts have matching bitness. Also, when you set PATHs and classpaths -cp remember to use ; instead of : on Windows.

@Edillower
Copy link
Author

Edillower commented Jun 22, 2017

Setting PATH is actually the solution to this problem.
I guess it didn’t work yesterday because I hadn't restart my computer or eclipse after setting the PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants