CxImage是一个丰富的图像上树立开源代码,Windows下编译简单,但是Linux下有很多问题,特此记录,其中部分问题和解决方法采用前辈的想法,在此一并谢过。
1. 下载Linux的cxp_w_picpath tar包
cxp_w_picpath 主页
Linux 包下载地址
2、下载后得到cxp_w_picpath599c_tar.zip,然后将其解压unzip cxp_w_picpath599c_tar.zip
tar xzvf cxp_w_picpath599c.tar.gz
cd cxp_w_picpath599c/
3、 ./configure; make
其中make时报错:cd . && /home/zhl/cxp_w_picpath599c/admin/missing aclocal-1.4
WARNING: `aclocal-1.4' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the `README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing `aclocal-1.4' program.
make: *** [aclocal.m4] Error 1
系统有安装高版本的automake,难道一定要切换到低版本?rpm -aq | grep automake
automake-1.13.4-3.el7.noarch
尝试手动修改Makefile里面aclocal的版本号,仍然有问题。最后发现重新生成 aclocal.m4和Makefile就可以了:
解决步骤如下:#重新生成 aclocal.m4
aclocal
#重新生成configure文件
autoconf -i -v -f
# 删除原来的makefile
find ./ -name Makefile -exec rm -rf {} \;
# 重新生成Makefile
./configure
出现如下错误:configure.in:98: warning: omit leading './' from config file names such as './Makefile';
configure.in:98: remake rules might be subtly broken otherwise
configure.in:62: error: required file 'admin/compile' not found
configure.in:62: 'automake --add-missing' can install 'compile'
make: *** [Makefile.in] Error 1
解决方法:automake --add-missing
make
4. 出现如下错误tif_xfile.cpp: In function ‘TIFF* _TIFFOpenEx(CxFile*, const char*)’:
tif_xfile.cpp:102: error: cast from ‘CxFile*’ to ‘int’ loses precision
make[3]: *** [tif_xfile.o] Error 1解决方法:修改代码 ./cxp_w_picpath/CxImage/tif_xfile.cpp
extern"C"TIFF* _TIFFOpenEx(CxFile* stream, constchar* mode){
//return (_TIFFFdOpen((int)stream, "TIFF IMAGE", mode));// 64bits 系统,int 改成long
return(_TIFFFdOpen((long)stream,"TIFF IMAGE", mode));
}
5. 采用vi编辑,结束采用:x