Is there anyone who succeed to include libjpeg in some compiler? I tried everything: Dev C++, VS10, CodeBlocks, copy the headers and the lib by hand, add with the linker but nothing. Right now I am really confisued as there is not an official guide on how to compile it in any compiler. I would be really happy if someone could provide a tutorial on how the library can be compiled in any compiler.
Thank you in advance.
Is there anyone who succeed to include libjpeg in some compiler? I tried everything:
Share
Here is how I’ve built libjpeg using MinGW on Windows :
1. Get MinGW with MSYS
I’ve got a copy from http://sourceforge.net/projects/mingw/.
Quoting from http://www.mingw.org :
We will need it to run the
configurescript that comes with libjpeg sources.2. Get libjpeg sources
From http://www.ijg.org/, take the Unix format package (the Windows one won’t work with this procedure). I took the
jpeg_8dversion.3. Prepare a building directory
I’ve made a temporary directory named
tmpinD:\, but you could choose whatever suits your needs. The thing that matters is the name of paths in MSYS. As it brings some * Unixity * to Windows, paths cannot be used in their original form.In a nutshell:
C:\path\to\filebecomes/c/path/to/filein MSYS land, an soD:\tmpbecomes/d/tmp.Decompress the libjpeg sources in
D:\tmp, so you have ajpeg-8ddirectory in there.Create a
jpeg-builddirectory insideD:\tmp, it will hold the built library.Now everything is ready for the build.
4. ./configure, make, make install
That is the mantra of building in Unix land. An option should be added to redirect the install process to
D:\tmp\jpeg-build.Run the following commands in an MSYS shell (also named MinGW shell in Windows start menu):
As an additional step, you can run
make testfor safety.These commands will build both static and shared versions of libjpeg.
5. Take the goods, delete the temporaries
If everything runs fine, you can delete the
D:\tmp\jpeg-8ddirectory, but keep thejpeg-buildone. It contains:includedirectory, containing libjpeg headers. You can move them to your compiler’s headers directory.libdirectory, with.afile to pass to the linker. You can move them to your compiler’s library directory.bindirectory, holding the libjpeg shared librarylibjpeg-8.dlland jpeg tools.sharedirectory, containingmanpages for the jpeg tools.You can now build your program and link it against libjpeg by indicating the right include and library paths.
You can find many details about the libjpeg building and installation process in
install.txtinside the source package.I hope this will be useful.