Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to import cpp dll in python?
Forum Updated to NodeBB v4.3 + New Features

how to import cpp dll in python?

Scheduled Pinned Locked Moved Unsolved General and Desktop
python3qt5
4 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Selvajothi
    wrote on last edited by
    #1

    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)

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

    JonBJ 1 Reply Last reply
    0
    • S Selvajothi

      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)

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

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Selvajothi
        wrote on last edited by
        #3

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

        JonBJ 1 Reply Last reply
        0
        • S Selvajothi

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

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved