   zlib problems (linking)
  I have been trying to use the zlib library, my problem though is that it doesn't seem to link correctly. I have created a little console application in VS2005, if I have a empty main function, and I include and link to zlib. The problem is that when I try to call gzopen I get the following error:Main.obj : error LNK2019: unresolved external symbol _gzopen referenced in function _mainIt seems that the lib file doesn't export gzopen, but when I try to use an application like this I can see gzopen is exported. I have tried to link to both the static library and the DLL, but none works.I cant find much (I cant find any at all) info on linking to zlib, I suspect the problems have something to do with zlib being written in C.So does anyone know how to solve my problem.   
  Did you link to "zdll.lib"? Also you might want to take a look at this thread for a neat little ZLIB wrapper that you could easily modify. I used its version of ZLIB for my stuff and I never had a problem, but this was quite some time ago, so I'm not sure about the most recent version, I'll see if I can find it.   ;  Thanks it helped, I didn't know I needed to link to zdll. I just looked for some project to build, and in zlib/contrib/vstudio/vs8 or something like that there is a project for vs2005 which I tried to build, this created DLls and .lib files so I thought I was going to link to those (zlibwapi.lib/zlibstat.lib).Anyway I have a new problem now, when I try to run the program it says that msvcr80.dll can't be found, which is really weird since I have VS2005 installed. Also when I remove my call to gzopen the program run perfectly.   ;Quote:Original post by CTarAnyway I have a new problem now, when I try to run the program it says that msvcr80.dll can't be found, which is really weird since I have VS2005 installed. Also when I remove my call to gzopen the program run perfectly.It would seem I don't have that .dll either, at least in my system32 folder, download it here and use that to see if it works properly now. The same thing happens with libPNG as well, libpng12.dll cannot be found, even after getting and building that library, so you have to download it online if you do not have it already. DLL hell at it's best [wink].[edit]Oh searching some more on the net, it should be found at: X:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT or however you have your stuff installed.   ;  Unfortunatly that doesn't work, I had already tried with my own version of MSVCR80.DLL (on my computer, searched for it) here it said that someone had tried to load the C runtime library incorrectly(R6034). When I tried it with the downloaded version of the file I got (translated from danish, so might not be the exact message someone else would get):Test.exe - Entry point not foundThe function entry-point _encode_pointer weren't in the DLL-library MSVCR80.Dll   ;  I think it has to do with how your ZLIB was built and or just mismatchs with the version you are using. I just recompiled my old ZLIB project in 2k5 and it works fine, so what you can do is try this:1. Download and use this binary version of ZLIB.2. When you need to include the header file, you must use:// Uses the ZLib libraryextern "C" {#include "zlib.h"}3. Link to ZDLL.lib4. Make sure the ZLIB1.dll file is in the working directory for your app.You should not have any missing dependecies now and it should work and link correctly, give it a try.   ;  Sorry for the late reply, I moved MSVCR80.DLL instead of copying it so I couldn't get VS2005 to start. It took some time to figure out what had happened. Anyway thanks for all the replies they have really helped me alot, your website doesn't seem to work (not in IE or FF, I couldn't even ping it) so I will just try to access it later.EDIT: It seems I have some problems with my network, so that might be the problem.   ;  It FINALLY works. Before I created the zlib1.dll with:nasm /f win32/makefile.mscBut apparently I needed to build the DLL from:zlib/projects/visualc6/zlib.dswThe problem was I recieved a lot of errors first time, so I assumed it was only for VS6, but I just needed to change the configuration from DLL ASM DEBUG to DLL DEBUG (and RELEASE after DEBUG).