Static libpng link with visual studio 2010

Posted by Sanctus2099 on Stack Overflow See other posts from Stack Overflow or by Sanctus2099
Published on 2010-06-02T09:30:03Z Indexed on 2010/06/02 9:33 UTC
Read the original article Hit count: 627

Filed under:
|
|
|

Hey guys. I'm trying to add PNG support to my application and thus I want to include libpng. I know it needs zlib and thus I downloaded that as well. I went into the png folder/projects/vstudio and I opened the solution. I compiled it and it went just fine. I added some headers from it into my application and I copied the lib files. My program is a dll written in c++ which is later used from C#. When I run it in C# it complains about not finding my dll (tough if I remove the png part it works fine). I've had this problem before and it usually means a dll dependency is wrong.
Now... libpng compiled both some .lib files and some .dll files. The dll files are bigger. My only guess is that it needs the dll files as well but I've seen that people can link to libpng without a dll.
So my questions is: How can I compile libpng(and zlib for that instance) into just static libraries and how can I include those in my projects? I've searched around the internet and I couldn't find anything useful.

© Stack Overflow or respective owner

Related posts about c++

Related posts about zlib