Thursday, December 24, 2009

Here's my notes from installing JPEG-7 on Windows

Take note: I install libraries into C:\DevFiles\Libraries\What\; with compiler specific files dumped under sub folders, e.g. C:\DevFiles\Libraries\zlib\msvc\zdll.lib and C:\DevFiles\Libraries\zlib\mingw\libzdll.a. Like wise, I leave a README.TXT file in the root, noting anything I will need to remember when it comes to using the library.


# build for Visual C++ 2008 / 9.0
> unzip "path\to\jpegsr7.zip"
# I want it in jpeg\src for safe keeping
> mkdir jpeg
> move jpeg-7 jpeg\src
# use the corresponding .vcX files for version
> copy makeasln.vc9 apps.sln
> copy makejsln.vc9 jpeg.sln
> copy makewvcp.vc9 wrjpgcom.vcproj
> copy maketvcp.vc9 jpegtran.vcproj
> copy makervcp.vc9 rdjpgcom.vcproj
> copy makedvcp.vc9 djpeg.vcproj
> copy makecvcp.vc9 cjpeg.vcproj
> copy makejvcp.vc9 jpeg.vcproj
> copy jconfig.vc jconfig.h
# I'm using vcbuild, since I read .vcproj files in vim; you may want the IDE
> vcbuild /nologo jpeg.sln "Release|Win32"
 ...
> vcbuild /nologo apps.sln "Release|Win32"
# I put compiler specific files in a suitable folder
> mkdir ..\msvc
> copy Release\jpeg.lib ..\msvc
# jconfig.h is compiler specific, so we dump it in our compiler directory
> copy jconfig.h ..\msvc\
> del jconfig.h


# build for MinGW/MSys
$ pushd /C/DevFiles/Libraries/jpeg/ 
$ pushd src
# works for most packages
$ ./configure  --prefix=/C/DevFiles/Libraries/jpeg/ --exec-prefix=/C/DevFiles/L
ibraries/jpeg/mingw/
$ make
$ make install
# move jconfig out of independent include and into compiler specific dir
$ mv ../include/jconfig.h 


Now copy jerror.h, jinclude.h, jmorecfg.h, jpegint.h, and jpeglib.h into ../include/. Those are the portable headers, that won't very based on compiler (MinGW/MSVC).


and here's my notes file:

MinGW -> static link as normal
MinGW -> Use import library libjpeg.dll.a for dynamic linking with libjpeg-7.dll
MinGW -> Last build JPEG-7 on 2009-12-24

MSVC -> Can only static link agaisnt jpeg.lib; must use /MD
MSVC -> also add msvc/ to include path, for jconfig.h
MSVC -> Last build JPEG-7 on 2009-12-23

In all cases, add include + compiler folders to your include path.

No comments:

Post a Comment