Procedure entry point could not be found?

10,906

Most likely you have updated the .h and .lib file, but are linking to an out of date DLL. Make sure that the DLL that your program links to is the one that matches the .h and .lib file.

You can debug what happens at program load time by running Dependency Walker in profile mode. That will show the full path to the DLL that is actually loaded and you will then be able to work out what has gone wrong.

Share:
10,906

Related videos on Youtube

ronag
Author by

ronag

Master of Science (M.Sc.), Software Engineering and Technology at Chalmers University of Technology. I wrote most of CasparCG 2.0 Server, an open-source video- and graphics playout server used by the Swedish Broadcasting Corporation 24/4 for all regional and national broadcasts in Sweden. Big fan of the ffmpeg project.

Updated on May 25, 2022

Comments

  • ronag
    ronag almost 2 years

    I've encountered a strange problem. After updating to the latest ffmpeg headers/lib/dll I keep getting the error:

    The procedure entry point __glewProgramUniform1i could not be located in the dynamic link library
    

    If I change so that I link to glew using static linking, then that specific error disappears and it instead complains about some other procedure entry point in some other dll, and so on.

    As soon as a revert to the old ffmpeg headers/lib/dll the problem disappears.

    What could cause this behavior? How do I debug this?

    NOTE: This only happens during release builds, not during debug builds.

    enter image description here

    enter image description here

    Depends profile log:

    Started "CONHOST.EXE" (process 0x1BBC) at address 0x000007F63CF60000.  Successfully hooked module.
    Loaded "NTDLL.DLL" at address 0x000007F945C30000.  Successfully hooked module.
    Loaded "KERNEL32.DLL" at address 0x000007F943400000.  Successfully hooked module.
    Loaded "KERNELBASE.DLL" at address 0x000007F942D10000.  Successfully hooked module.
    DllMain(0x000007F942D10000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNELBASE.DLL" called.
    DllMain(0x000007F942D10000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNELBASE.DLL" returned 1 (0x1).
    DllMain(0x000007F943400000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNEL32.DLL" called.
    DllMain(0x000007F943400000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "KERNEL32.DLL" returned 1 (0x1).
    Injected "DEPENDS.DLL" at address 0x000000005ACD0000.
    DllMain(0x000000005ACD0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DEPENDS.DLL" called.
    DllMain(0x000000005ACD0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DEPENDS.DLL" returned 1 (0x1).
    Loaded "GDI32.DLL" at address 0x000007F945970000.  Successfully hooked module.
    Loaded "USER32.DLL" at address 0x000007F943860000.  Successfully hooked module.
    Loaded "MSVCRT.DLL" at address 0x000007F945430000.  Successfully hooked module.
    Loaded "IMM32.DLL" at address 0x000007F945320000.  Successfully hooked module.
    Loaded "OLEAUT32.DLL" at address 0x000007F9454E0000.  Successfully hooked module.
    Loaded "COMBASE.DLL" at address 0x000007F9457C0000.  Successfully hooked module.
    Loaded "MSCTF.DLL" at address 0x000007F944FD0000.  Successfully hooked module.
    Loaded "RPCRT4.DLL" at address 0x000007F944CF0000.  Successfully hooked module.
    Entrypoint reached. All implicit modules have been loaded.
    DllMain(0x000007F943860000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "USER32.DLL" called.
    DllMain(0x000007F945430000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "MSVCRT.DLL" called.
    DllMain(0x000007F945430000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "MSVCRT.DLL" returned 1 (0x1).
    DllMain(0x000007F943860000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "USER32.DLL" returned 1 (0x1).
    DllMain(0x000007F945970000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "GDI32.DLL" called.
    DllMain(0x000007F945970000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "GDI32.DLL" returned 1 (0x1).
    DllMain(0x000007F944FD0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "MSCTF.DLL" called.
    DllMain(0x000007F944FD0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "MSCTF.DLL" returned 1 (0x1).
    DllMain(0x000007F945320000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "IMM32.DLL" called.
    DllMain(0x000007F945320000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "IMM32.DLL" returned 1 (0x1).
    DllMain(0x000007F944CF0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "RPCRT4.DLL" called.
    DllMain(0x000007F944CF0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "RPCRT4.DLL" returned 1154577921 (0x44D17601).
    DllMain(0x000007F9457C0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "COMBASE.DLL" called.
    DllMain(0x000007F9457C0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "COMBASE.DLL" returned 1 (0x1).
    DllMain(0x000007F9454E0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "OLEAUT32.DLL" called.
    DllMain(0x000007F9454E0000, DLL_PROCESS_ATTACH, 0x00000019CF36F8C0) in "OLEAUT32.DLL" returned 1 (0x1).
    Loaded "UXTHEME.DLL" at address 0x000007F941950000.  Successfully hooked module.
    DllMain(0x000007F941950000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "UXTHEME.DLL" called.
    DllMain(0x000007F941950000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "UXTHEME.DLL" returned 1 (0x1).
    Error writing a breakpoint at the entrypoint return of "".  Entrypoint cannot be hooked. Invalid access to memory location (998).
    Loaded "" at address 0x00000019D1220000.  Successfully hooked module.
    Unloaded "" at address 0x00000019D1220000.
    Loaded "START8_64.DLL" at address 0x000007F93A130000.  Successfully hooked module.
    DllMain(0x000007F93A130000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "START8_64.DLL" called.
    GetProcAddress(0x000007F943860000 [USER32.DLL], "CreateWindowInBand") called from "START8_64.DLL" at address 0x000007F93A1C0941 and returned 0x000007F943872C20.
    LoadLibraryA("ADVAPI32.dll") called from "START8_64.DLL" at address 0x000007F93A1A1D5C.
    Loaded "ADVAPI32.DLL" at address 0x000007F944E40000.  Successfully hooked module.
    Loaded "SECHOST.DLL" at address 0x000007F9439B0000.  Successfully hooked module.
    DllMain(0x000007F9439B0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "SECHOST.DLL" called.
    DllMain(0x000007F9439B0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "SECHOST.DLL" returned 1 (0x1).
    DllMain(0x000007F944E40000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "ADVAPI32.DLL" called.
    DllMain(0x000007F944E40000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "ADVAPI32.DLL" returned 1 (0x1).
    LoadLibraryA("ADVAPI32.dll") returned 0x000007F944E40000.
    GetProcAddress(0x000007F944E40000 [ADVAPI32.DLL], "RegOpenKeyExW") called from "START8_64.DLL" at address 0x000007F93A1A1E59 and returned 0x000007F944E413D0.
    GetProcAddress(0x000007F944E40000 [ADVAPI32.DLL], "RegQueryValueExW") called from "START8_64.DLL" at address 0x000007F93A1A1E59 and returned 0x000007F944E413F0.
    GetProcAddress(0x000007F944E40000 [ADVAPI32.DLL], "RegCloseKey") called from "START8_64.DLL" at address 0x000007F93A1A1E59 and returned 0x000007F944E413B0.
    GetProcAddress(0x000007F943860000 [USER32.DLL], "GetWindowBand") called from "START8_64.DLL" at address 0x000007F93A1C0A91 and returned 0x000007F943863210.
    GetProcAddress(0x000007F943860000 [USER32.DLL], "SetWindowBand") called from "START8_64.DLL" at address 0x000007F93A1C0AC1 and returned 0x000007F943872BB0.
    DllMain(0x000007F93A130000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "START8_64.DLL" returned 1 (0x1).
    Loaded "DWMAPI.DLL" at address 0x000007F941120000.  Successfully hooked module.
    DllMain(0x000007F941120000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DWMAPI.DLL" called.
    DllMain(0x000007F941120000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "DWMAPI.DLL" returned 1 (0x1).
    Loaded "COMCTL32.DLL" at address 0x000007F940010000.  Successfully hooked module.
    DllMain(0x000007F940010000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "COMCTL32.DLL" called.
    DllMain(0x000007F940010000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "COMCTL32.DLL" returned 1 (0x1).
    Loaded "OLE32.DLL" at address 0x000007F945AB0000.  Successfully hooked module.
    DllMain(0x000007F945AB0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "OLE32.DLL" called.
    DllMain(0x000007F945AB0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "OLE32.DLL" returned 1 (0x1).
    Loaded "CRYPTBASE.DLL" at address 0x000007F9429A0000.  Successfully hooked module.
    Loaded "BCRYPTPRIMITIVES.DLL" at address 0x000007F942940000.  Successfully hooked module.
    DllMain(0x000007F942940000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "BCRYPTPRIMITIVES.DLL" called.
    DllMain(0x000007F942940000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "BCRYPTPRIMITIVES.DLL" returned 1 (0x1).
    DllMain(0x000007F9429A0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "CRYPTBASE.DLL" called.
    DllMain(0x000007F9429A0000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "CRYPTBASE.DLL" returned 1 (0x1).
    Loaded "SHCORE.DLL" at address 0x000007F941D20000.  Successfully hooked module.
    DllMain(0x000007F941D20000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "SHCORE.DLL" called.
    DllMain(0x000007F941D20000, DLL_PROCESS_ATTACH, 0x0000000000000000) in "SHCORE.DLL" returned 1 (0x1).
    
    • WildCrustacean
      WildCrustacean over 11 years
      Have you used some tools (linker startup banner, depends, dumpbin, etc) to verify that you are linking the libraries you intended?
    • ronag
      ronag over 11 years
      I have not, I am not familiar with any of those.
    • ronag
      ronag over 11 years
      And I am just overwriting old files with new ones, so I assume my linker settings are correct...
    • ronag
      ronag over 11 years
      Also, each time I do a rebuild solution it complains about some other procedure entry point.
    • WildCrustacean
      WildCrustacean over 11 years
      I would recommend dealing with this sort of problem by turning on the linker startup banner to verify which files it is including, and then using depends and/or dumpbin /HEADERS to make sure you have the right libraries and that they have the symbols you want. Also try cleaning the solution or manually removing all binaries and rebuilding to make sure you don't have old stuff laying around for it to find.
    • ronag
      ronag over 11 years
      I've run depends, and I'm getting some wierd symbols in the ffmpeg dlls (see edited answer)... that should not be there?
    • WildCrustacean
      WildCrustacean over 11 years
      That looks like depends can't find some of the ffmpeg dlls, which might be a problem. You can check your path settings, or if you keep the dlls with the executable check that they are all there and are the versions you expected. If you see symbols you think should not be there, maybe it is finding some other dll that you don't want?
    • ronag
      ronag over 11 years
      The dlls are with the exe, and they should be the same version. As I said previously it works fine in debug with the new files, and works both in debug and release with the old files. I've run depends in profile mode, see edited post.
    • Samuel
      Samuel about 3 years
      I think this post will help you stackoverflow.com/questions/16867607/…
  • ronag
    ronag over 11 years
    I have made sure (multiple times) that they are from the same build.
  • David Heffernan
    David Heffernan over 11 years
    That seems implausible. If that is so you need to either re-build the DLL from source, or contact whoever supplied it to you and ask them to fix it. I still suspect the error is on your side. Run Dependency Walker in Profile Mode (Profile | Start Profiling). And see which DLL is actually loaded.
  • ronag
    ronag over 11 years
    I've run Dependency Walker... but it makes not much sense, it tries to load ""/empty-string? (see edited post).
  • David Heffernan
    David Heffernan over 11 years
    Your profile analysis seems to pick at the wrong part of the log. Look for the bit that mentions __glewProgramUniform1i.
  • David Heffernan
    David Heffernan over 11 years
    Seems odd. When you run in profile mode, do you see the same error message as in the question?
  • ronag
    ronag over 11 years
    No, I do not. I have added the log (at the point of the error) to the question.
  • ronag
    ronag over 11 years
    I think the suspicious part is, Error writing a breakpoint at the entrypoint return of "". Entrypoint cannot be hooked. Invalid access to memory location (998). Loaded "" at address 0x00000019D1220000. Successfully hooked module. Unloaded "" at address 0x00000019D1220000.
  • David Heffernan
    David Heffernan over 11 years
    Well, if you don't see the same error when running in profile mode, you aren't profiling the right thing! You have to profile the thing that exhibits the fault.
  • ronag
    ronag over 11 years
    Not sure how I can be profiling the wrong thing. I open the exe in depends, then press start profiling and ok, the application starts and I get the error.
  • David Heffernan
    David Heffernan over 11 years
    I interpreted your last comment as saying that you didn't get the same error.....
  • ronag
    ronag over 11 years
    I missunderstood your question. I thought you were asking if I saw the error in the log, which I don't, however the error message box still appears.
  • David Heffernan
    David Heffernan over 11 years
    I don't understand that. I don't know why Depends would not report that.
  • ronag
    ronag over 11 years
    Something was wrong with the .lib files. I rebuilt them from the corresponding .def files.