安装 tiff-4.0.3 时出现以下错误:
pranav@pranav-Inspiron-1545:~$ cd dependency/
pranav@pranav-Inspiron-1545:~/dependency$ tar -xvf libtiff4-3.6.0-5.tar.bz2
usr/bin/cygtiff4.dll
pranav@pranav-Inspiron-1545:~/dependency$ tar -xvf libtiff4-3.6.0-5-src.tar.bz2
Libtiff is now configured for i686-pc-linux-gnu
Installation directory: /usr/local
Documentation directory: ${prefix}/share/doc/tiff-4.0.3
C compiler: gcc -g -O2 -Wall -W
C++ compiler: g++ -g -O2
Enable runtime linker paths: no
Enable linker symbol versioning: no
Support Microsoft Document Imaging: yes
Use win32 IO: no
Support for internal codecs:
CCITT Group 3 & 4 algorithms: yes
Macintosh PackBits algorithm: yes
LZW algorithm: yes
ThunderScan 4-bit RLE algorithm: yes
NeXT 2-bit RLE algorithm: yes
LogLuv high dynamic range encoding: yes
Support for external codecs:
ZLIB support: yes
Pixar log-format algorithm: yes
JPEG support: yes
Old JPEG support: yes
JPEG 8/12 bit dual mode: no
ISO JBIG support: no
LZMA2 support: no
C++ support: yes
OpenGL support: no
pranav@pranav-Inspiron-1545:~/dependency/tiff-4.0.3$ make
Making all in port
make[1]: Entering directory `/home/pranav/dependency/tiff-4.0.3/port'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pranav/dependency/tiff-4.0.3/port'
Making all in libtiff
make[1]: Entering directory `/home/pranav/dependency/tiff-4.0.3/libtiff'
make all-am
make[2]: Entering directory `/home/pranav/dependency/tiff-4.0.3/libtiff'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -W -MT tif_jpeg.lo -MD -MP -MF .deps/tif_jpeg.Tpo -c -o tif_jpeg.lo tif_jpeg.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -g -O2 -Wall -W -MT tif_jpeg.lo -MD -MP -MF .deps/tif_jpeg.Tpo -c tif_jpeg.c -fPIC -DPIC -o .libs/tif_jpeg.o
In file included from /usr/local/include/jpeglib.h:27:0,
from tif_jpeg.c:88:
/usr/local/include/jmorecfg.h:263:16: error: expected identifier before numeric constant
**make[2]: *** [tif_jpeg.lo] Error 1 **
**make[2]: Leaving directory `/home/pranav/dependency/tiff-4.0.3/libtiff' **
**make[1]: *** [all] Error 2**
make[1]: Leaving directory `/home/pranav/dependency/tiff-4.0.3/libtiff'
**make: *** [all-recursive] Error 1 **
我该如何消除这些错误?
答案1
Ubuntu 不再支持您尝试安装的 libtiff4 版本,但有较新版本的 libtiff4 可用。可以找到适用于所有 Ubuntu 版本的 libtiff4 版本列表(按 Ubuntu 版本名称排序)这里。
您可以打开 Ubuntu 软件中心并在搜索框中输入“libtiff4”来找到与您的系统匹配的 libtiff4 版本。
在 Ubuntu 14.04-20.04 中,libtiff4 包已被 libtiff5 取代。
答案2
typedef enum { FALSE= 0, TRUE= 1 } boolean;
这对我不起作用。但是,这有效:
//typedef enum { FALSE= 0, TRUE= 1 } boolean;
#define boolean bool
是的,很丑,但是至少它可以编译。
答案3
只需编辑第 263 行的文件/usr/local/include/jmorecfg.h
并替换符号前的空格=
。
改变
typedef enum { FALSE = 0, TRUE = 1 } boolean;
到
typedef enum { FALSE= 0, TRUE= 1 } boolean;