-2

I have read almost all of the entries here on SO, still the module wont load.

Here is my code

myDll = cdll.LoadLibrary("C:\\Users\\GODWIN\\Desktop\\libavformat\\libavformat-56.dll")

and this is the error it gives

OSError: [WinError 126] The specified module could not be found
surge10
  • 622
  • 6
  • 18
  • 1
    Seems strange that you are using both a raw string and double back-slashes - there is no need for both but I can't say if that is the issue since I can't try it: see https://stackoverflow.com/questions/1940578/windowserror-error-126-the-specified-module-could-not-be-found – cdarke Aug 02 '18 at 15:43
  • Thanks it is not. – surge10 Aug 02 '18 at 15:46
  • 1
    I just wanted to make sure: Is there actually a file at `C:\\Users\\GODWIN\\Desktop\\libavformat\\libavformat-56.dll`? Can you put it in the address bar in Windows Explorer and it opens a file? I would assume "of course", but you never know. – Luke B Aug 02 '18 at 15:50
  • @pydude yes there is. – surge10 Aug 02 '18 at 15:53

2 Answers2

0

You should try:

windll.LoadLibrary()

It depends on the calling convention of the dll.

__cdecl and __stdcall

edit:

After further investigation I noticed that it's most likely due to the path format. Try forward slashes or raw string format.

edit2:

As suggested here you should install Visual C++ Redistributable for Visual Studio 2015

Mick_
  • 131
  • 9
  • `windll` and `cdll` won't matter if the DLL won't load. They just select the default calling convention of the functions. – Mark Tolonen Aug 02 '18 at 20:55
0

If your path is accurate, you are missing a dependency DLL. Use a tool like dumpbin to determine the dependencies or Process Monitor (see this answer for an example).

Mark Tolonen
  • 166,664
  • 26
  • 169
  • 251