user974967
user974967

Reputation: 2946

GetProcAddress, Error 127 (ERROR_PROC_NOT_FOUND)

I am trying to call a function defined in a DLL, documented here:

http://xiph.org/vorbis/doc/vorbisfile/ov_fopen.html

LoadLibraryA is successful and GetProcAddress seems to return a valid address for every other function I've tried it with. Here it returns NULL here and GetLastError() returns 127 (ERROR_PROC_NOT_FOUND).

const char* dllName = "libvorbisfile.dll";
mhDll = LoadLibraryA(dllName);
typedef int (__cdecl *OV_FOPEN)(char*, OggVorbis_File*);
OV_FOPEN ProcFOpen = (OV_FOPEN) GetProcAddress(mhDll, "ov_fopen");

What can I do?

Upvotes: 0

Views: 10300

Answers (2)

Raymond Chen
Raymond Chen

Reputation: 45172

According to this discussion thread, some versions of libvorbisfile.dll are missing ov_fopen.

Upvotes: 4

Carey Gregory
Carey Gregory

Reputation: 6846

Examine the DLL with Depends and find out why you can't find the function. It's probably either just the name is wrong in the documentation or there's a name mangling issue.

Upvotes: 3

Related Questions