I’m using Python 2.7.3 on Windows XP via the IDLE GUI, and I’m trying to run Z3 4.0 locally via the Python API.
This line works fine:
>>> from z3 import *
This line doesn’t:
>>> x = Int('x')
Traceback (most recent call last):
[...]
File "C:\Program Files\Microsoft Research\Z3-4.0\python\z3core.py", line 34, in init
_lib = ctypes.CDLL(PATH)
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
Anyone know what the problem could be?
My PYTHONPATH is set to “C:\Program Files\Microsoft Research\Z3-4.0\python”, without the quotes.
Z3 uses thread local storage. It is implemented using __declspec(thread). Unfortunately, this is not supported by DLLs in Windows XP and Server 2003. From MSN documentation:
“For DLLs that are loaded dymanically after the process has started (delay load, COM objects, explicit LoadLibrary, etc) __declspec(thread) does not work on Windows XP, 2003 Server and earlier OSes, but does work on Vista and 2008 Server.”
So, to use the Z3 DLL, you must use one of the following Windows: 8, 7, Vista or Server 2008.