3

I have a problem, I build and link a windows application on linux for windows using mxe (x86_64-w64-mingw32.shared), the build an linking is working well. Then I copy paste all usefull dll (that are all cross-compiled, except x64-msvcrt-ruby230.dll, which I get from the official windows installer).

I tested my program with wine, no problem it works like a charme and I spot no difference with the linux version. But once I put everything in my test VM (windows10 64bit inside virtualbox) I receive the error message:

The procedure entry point inflateValidate could not be located in the dynamic link library D:\libpng16-16.dll.

libpng16-16.dll is there, and when I objectdump it (in linux):

objdump -x libpng16-16.dll | grep inflate

3a9f4      60  inflate
3aa00      66  inflateEnd
3aa10      69  inflateInit2_
3aa20      73  inflateReset
3aa30      74  inflateReset2
3aa40      80  inflateValidate
[642](sec  1)(fl 0x00)(ty  20)(scl   3) (nx 0) 0x0000000000013be0 png_inflate_claim
[654](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000014280 png_zlib_inflate
[655](sec  1)(fl 0x00)(ty  20)(scl   3) (nx 0) 0x00000000000142d0 png_inflate.constprop.6
[657](sec  1)(fl 0x00)(ty  20)(scl   3) (nx 0) 0x0000000000014680 png_inflate_read.part.3.constprop.8
[3002](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b08 inflateReset2
[3023](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b28 inflate
[3081](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b00 inflateValidate
[3088](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000578 __imp_inflateReset2
[3119](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000568 __imp_inflateInit2_
[3138](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000560 __imp_inflateEnd
[3143](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b10 inflateReset
[3155](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000558 __imp_inflate
[3162](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000580 __imp_inflateValidate
[3197](sec  8)(fl 0x00)(ty   0)(scl   2) (nx 0) 0x0000000000000570 __imp_inflateReset
[3244](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b20 inflateEnd
[3253](sec  1)(fl 0x00)(ty  20)(scl   2) (nx 0) 0x0000000000021b18 inflateInit2_

So apparently the symbol __imp_inflateValidate is present, so is there something I'm missing ? And does anybody know how to fix this ?

Thanks in advance

Laurent Jospin
  • 604
  • 5
  • 9

3 Answers3

4

Just stumbled on the same problem. It turned out to be a confilicting dll file in the PATH environment varialble. try the ldd command to find out which dll files might be suspicious.

for instance, in my case, the culprit is the zlib1.dll from the Intel wireless software.


    E:\samples\sfmlSound>ldd sfmlSound.exe
            ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffee3e70000)
            KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffee3030000)
            ...
            zlib1.dll => /c/Program Files/Intel/WiFi/bin/zlib1.dll (0x7ffed0f10000)
            ...

after resolved the conflicts, the program would load correctly.

书呆彭
  • 101
  • 4
  • For mzself it was because some dependancies of the official ruby dll was not consistent with the one compiled by mxe. I built ruby from scratch for windows on linux and it worked. – Laurent Jospin Jan 29 '19 at 16:16
0

In my case I replaced the libpng16-16 file and that worked.

CarbonMan
  • 4,350
  • 12
  • 54
  • 75
0

I just stumbled onto a similar issue while trying to run some code based on libpng16-16.dll. Apparently some build version of SDL_Image was broken: https://github.com/libsdl-org/SDL_image/issues/131, discussed in this article: https://discourse.libsdl.org/t/sdl2-image-fails-loading-libpng-on-latest-versions-when-cross-compiling/24494/

For me it worked to rollback to an older version and to make sure both libpng16-16.dll and zlib1.dll were both in the folder of the executable. (Of course together with the other required DLLs)

Versions of SDL_image can be found here: https://www.libsdl.org/projects/SDL_image/release/

darclander
  • 1,526
  • 1
  • 13
  • 35