Qt World Summit: Submit your Presentation

how to import cpp dll in python?

  • I have created a .dll in cpp anf i tried to import it in python. I have tried the following code and it throws error.
    mydll = ctypes.cdll.LoadLibrary(dllpath)

    self._handle = _dlopen(self._name, mode)
    OSError: [WinError 127] The specified procedure could not be found

  • @Selvajothi
    I don't know if this is the right way to do it, but start by verifying dllpath can be found. Is it a relative path (to what?), does it exist? Does it have further DLL dependencies which cannot be found? The message implies to me that a procedure in it cannot be found, but if that is all your code you do not seem to have got that far.

  • I have checked the path and it exist. But the .dll is not in the same folder of the python path.

  • @Selvajothi
    There could be many causes. I suggest you Google for _dlopen specified procedure. Note that the error you show is on procedure, not on module.

Log in to reply