Page 1 of 1

Why OpenLibrary() fails?

Posted: Mon Jun 24, 2019 1:55 pm
by rotacak
Hello,

can anyone help me with OpenLibrary()? Why this 32 bit dll cannot be opened in 5.70 LTS x86?

This will print "0":

Code: Select all

Debug OpenLibrary(0, "e:\dev\x264grabtest\libx264-157.dll")
I can open another library, but not this one.

Download dll: http://www.mediafire.com/file/dl1g9vg44 ... 7.dll/file

Re: Why OpenLibrary() fails?

Posted: Mon Jun 24, 2019 2:14 pm
by fryquez
The dll have dependencies, try SetCurrentDirectory() before you open it..

Code: Select all

SetCurrentDirectory("e:\dev\x264grabtest\")
Debug OpenLibrary(0, "e:\dev\x264grabtest\libx264-157.dll")

Re: Why OpenLibrary() fails?

Posted: Mon Jun 24, 2019 2:33 pm
by rotacak
fryquez wrote:The dll have dependencies, try SetCurrentDirectory() before you open it..

Code: Select all

SetCurrentDirectory("e:\dev\x264grabtest\")
Debug OpenLibrary(0, "e:\dev\x264grabtest\libx264-157.dll")
Hmm, still not work. Is there any way how to show some error message, why it is not opened?

Re: Why OpenLibrary() fails?

Posted: Mon Jun 24, 2019 2:41 pm
by User_Russian
For libx264-157.dll needed libgcc_s_dw2-1.dll.

Re: Why OpenLibrary() fails?

Posted: Tue Jun 25, 2019 7:17 am
by infratec
You can use depends.exe 'Dependency Walker' to see that LIBGCC_S_DW2-1.dll is needed beside the LIBX264-157.dll

Re: Why OpenLibrary() fails?

Posted: Tue Jun 25, 2019 8:27 pm
by rotacak
Also libwinpthread-1.dll is needed by libgcc_s_dw2-1.dll. I used 'Dependency Walker' and I finally can open that dll. Thank you guys.