Make libjpeg (windows8.1 MinGW MSYS) - baidut/co-codec GitHub Wiki
related links
Install MSYS
MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell.
If you have installed mingw, select the install directory when the post-install cmd window pops up. I have installed Qt with mingw, so I select that folder.
Make libjpeg
open an MSYS shell, switch to the directory of jpeg-9a, then input ./configure
John@YINGZHENQIANG /e/github/co-codec/imageCompression/jpeg-9a
$ ./configure
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
// --------------Omission--------------------
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking libjpeg version number... 10:0:1
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating jconfig.h
config.status: executing depfiles commands
config.status: executing libtool commands
John@YINGZHENQIANG /e/github/co-codec/imageCompression/jpeg-9a
$ make
oops!
make all-am
make[1]: Entering directory `/e/github/co-codec/imageCompression/jpeg-9a'
CC jaricom.lo
CC jcapimin.lo
jcapimin.c:127:1: error: conflicting types for 'jpeg_suppress_tables'
jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress)
^
jcapimin.c:128:1: note: an argument type that has a default promotion can't matc
h an empty parameter name list declaration
{
^
In file included from jcapimin.c:22:0:
jpeglib.h:1004:14: note: previous declaration of 'jpeg_suppress_tables' was here
EXTERN(void) jpeg_suppress_tables JPP((j_compress_ptr cinfo,
^
make[1]: *** [jcapimin.lo] Error 1
make[1]: Leaving directory `/e/github/co-codec/imageCompression/jpeg-9a'
make: *** [all] Error 2
John@YINGZHENQIANG /e/github/co-codec/imageCompression/jpeg-9a
$
Add the following definition to the jconfig.h
#define HAVE_PROTOTYPES 1
and input make
again
./.libs/lt-djpeg.c:162:141: error: stray '\' in program
./.libs/lt-djpeg.c:162:141: error: stray '\' in program
d:\Qt\Qt5.2.1\Tools\mingw48_32\bin\strip.exe: './djpeg.exe': No such file
./libtool: line 9503: ./djpeg.exe: No such file or directory
CC jpegtran.o
jpegtran.c: In function 'usage':
jpegtran.c:93:3: warning: implicit declaration of function 'exit' [-Wimplicit-fu
nction-declaration]
exit(EXIT_FAILURE);
^
// --------------Omission--------------------
wrjpgcom.c:550:2: warning: incompatible implicit declaration of built-in functio
n 'exit' [enabled by default]
exit(EXIT_FAILURE);
^
wrjpgcom.c:581:3: warning: incompatible implicit declaration of built-in functio
n 'exit' [enabled by default]
exit(EXIT_SUCCESS);
^
CCLD wrjpgcom.exe
make[1]: Leaving directory `/e/github/co-codec/imageCompression/jpeg-9a'
/e/github/co-codec/imageCompression/jpeg-9a
now, goto directory .libs
!
reference
- jconfig.h是做什么用的?
- MinGW 编译zlib、libpng、libjpeg等
- MinGW 如何编译 libiconv,libz,libjpeg…[原文](http://www.cnblogs. * com/loongfee/archive/2011/11/30/2268991.html)
- BMP转JPG(法一)VS2005环境下采用makefile编译、使用libjpeg.lib函数库
read more