7

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

lezebulon
  • 7,607
  • 11
  • 42
  • 73
  • 1
    Click the "Binaries" zip link. You'll get a zip with a bin subdirectory. That contains the jpeg64.dll that you need. Copy it to you solution's Debug directory. Consider gdiplus.h or WIC if you don't like fighting the ball of wax problems. – Hans Passant May 27 '12 at 21:10

1 Answers1

8

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.

alexisdm
  • 29,448
  • 6
  • 64
  • 99
  • I know this is a fairly old question, but I'd be glad if you help me. Why is it called jpeg62.dll and not jpeg.dll? Is jpeg.lib pointing to it? turbojpeg.dll exists though. – Vahagn Tumanyan Mar 16 '16 at 15:02
  • 2
    @VahagnTumanyan Because on Windows you can't have multiple incompatible versions of the same library sharing the same name like the ".so" on unix, with the version, 6.2, as part of the name, you could use the v6 library simultaneously with the latest v9. jpeg.lib points to jpeg62.dll and turbojpeg.dll is supposed to be ABI compatible with the libjpeg v6b library (according to [wikipedia](https://en.wikipedia.org/wiki/Libjpeg) ), so renaming it to jpeg62.dll might work. – alexisdm Mar 17 '16 at 11:14