how to install libjpeg for windows?

2019-06-22 12:51发布

问题:

I downloaded some code that make use of libjpeg, but no dlls in the source files are included, and I'm trying to make it compile / execute correctly.

I am using VS2010: in my source files I have #include "jpeglib.h" and in Linker > Input > Additional Dependencies I have jpeg.lib, both of which can't be found on my computer.

I managed to go here : http://gnuwin32.sourceforge.net/packages/jpeg.htm and downloaded the "developer files" archives, which indeed contains the header and the .lib file. The programs compiles fine, but when I execute the .exe I have a jpeg62.dll missing error that I don't understand.

How am I supposed to solve this?

First off, I couldn't find any jpeg62.dll file on the previous website.

Secondly, I wonder why I need a dll since I thought that using .lib files for the link meant that I wouldn't need dlls for my programm to run. Any help is appreciated

回答1:

You should also download the "binaries" and "dependencies" packages from the GnuWin32 site. The jpeg62.dll is in the bin directory of the "binaries" archive.

A .lib file isn't always a complete static library, it can also be an import library for a dll which then must be present when the program is run.