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 26 Apr 2021, 11:32 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

    J 1 Reply Last reply 26 Apr 2021, 11:39
    0
    • S Selvajothi
      26 Apr 2021, 11:32

      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

      J Offline
      J Offline
      JonB
      wrote on 26 Apr 2021, 11:39 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 26 Apr 2021, 11:46 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.

        J 1 Reply Last reply 26 Apr 2021, 11:56
        0
        • S Selvajothi
          26 Apr 2021, 11:46

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

          J Offline
          J Offline
          JonB
          wrote on 26 Apr 2021, 11:56 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

          4/4

          26 Apr 2021, 11:56

          • Login

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