Author Topic: zlib.dll not found no matter what  (Read 3153 times)

0 Members and 1 Guest are viewing this topic.

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
zlib.dll not found no matter what
« on: January 02, 2020, 09:16:22 pm »
I get an error every time i run the program that says "Could not find dynamic library file". However zlib.dll and zlib1.dll is in the QB64 directory, system32, and syswow64.
I have tried it with the ".\" and full directory as well.  Oddly it will work on one machine but not the other. And the one it is not working on is a fresh install of windows, however it was running on it before.


Code: QB64: [Select]
  1. $IF WIN THEN
  2.     $IF 32BIT THEN
  3.         DECLARE LIBRARY "zlib1"
  4.         FUNCTION zlibVersion$ ()
  5.         FUNCTION zlibCompileFlags~& ()
  6.         FUNCTION compressBound& (BYVAL len AS LONG)
  7.         FUNCTION compress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
  8.         FUNCTION compress2& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG, BYVAL level AS LONG)
  9.         FUNCTION uncompress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
  10.         FUNCTION crc32~& (BYVAL PNGCRC AS LONG, BYVAL buf AS _OFFSET, BYVAL len AS LONG)
  11.         FUNCTION adler32~& (BYVAL adler AS LONG, BYVAL buf AS _OFFSET, BYVAL len AS LONG)
  12.         FUNCTION zError$ (BYVAL codenum AS INTEGER)
  13.         END DECLARE
  14.     $ELSE
  15.         DECLARE DYNAMIC LIBRARY "zlib"
  16.             FUNCTION zlibVersion$ ()
  17.             FUNCTION zlibCompileFlags~& ()
  18.             FUNCTION compressBound& (BYVAL len AS LONG)
  19.             FUNCTION compress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
  20.             FUNCTION compress2& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG, BYVAL level AS LONG)
  21.             FUNCTION uncompress& (BYVAL dest AS _OFFSET, destLen AS LONG, BYVAL source AS _OFFSET, BYVAL sourceLen AS LONG)
  22.             FUNCTION crc32~& (BYVAL PNGCRC AS LONG, BYVAL buf AS _OFFSET, BYVAL len AS LONG)
  23.             FUNCTION adler32~& (BYVAL adler AS LONG, BYVAL buf AS _OFFSET, BYVAL len AS LONG)
  24.             FUNCTION zError$ (BYVAL codenum AS INTEGER)
  25.         END DECLARE
  26.     $END IF
  27.  

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: zlib.dll not found no matter what
« Reply #1 on: January 02, 2020, 09:20:41 pm »
Is it a 32-bit version of QB64, or a 64-bit version?  They use 2 different library files, so make certain that both are in the current directory so they can be found.

You might also try to change that line to :

       DECLARE LIBRARY "./zlib1"

and:

        DECLARE DYNAMIC LIBRARY "./zlib"




If all else fails, you can always hard code the path to the library, to make certain it'll be found.

        DECLARE DYNAMIC LIBRARY "C:\Your Dir\Sub Dir\zlib"
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: zlib.dll not found no matter what
« Reply #2 on: January 02, 2020, 09:28:18 pm »
both files are in all of the directories. I have also tried it with ./ and hard coded directory and I get the same error.

Offline Craz1000

  • Forum Regular
  • Posts: 111
  • I'm OK
    • View Profile
    • Craz1000.net
Re: zlib.dll not found no matter what
« Reply #3 on: January 02, 2020, 09:32:34 pm »
I don't know why, and it makes no sense, I installed the 2015 C++ distribution and now it runs fine.