I’ve been trying to do this for a long time, and that is to get the zlib library to work with my program. I’m using Microsoft Visual C++ 2008 Express Edition with a CLR Windows Forms Application. The thing is I’m worried that zlib is to old to work with what I’m using. All the examples (the very few examples) of zlib I find are with a Win32 application.
And that’s the other thing; I can’t find any zlib examples that aren’t outdated. And I do understand that zlib is old, but I can’t find any alternatives 🙁
So if anyone could first of all tell me if its possible to use zlib with my application, and how, thanks a bunch. If someone wants to take it a step further and maybe recommend a better zlib-like program that I can use, thanks even more.
(And by the way, I’m creating an application to read the level data of the game Minecraft. A little can be found on that here.)
It is not a problem, C++/CLI was made to handle tasks like this. You have to tell the compiler that the zlib header isn’t managed code with #pragma managed and tell the linker to link the import library. Like this, in a sample console mode app:
Only other thing you have to do is to get the DLL copied into the build directory so you can debug the code. Project + Properties, Build Events, Post-Build Event, Command line:
Maybe you want to pick a different install directory 🙂