CxImage是一个丰富的图像上树立开源代码,Windows下编译简单,但是Linux下有很多问题,特此记录,其中部分问题和解决方法采用前辈的想法,在此一并谢过。
1. 下载Linux的cximage tar包
cximage 主页
Linux 包下载地址
http://www.xdp.it/cgi-bin/dl.pl?cximage/cximage599c_tar
2、下载后得到cximage599c_tar.zip,然后将其解压
[plain] view plain copy
-
unzip cximage599c_tar.zip tar xzvf cximage599c.tar.gz cd cximage599c/
3、 ./configure; make
其中make时报错:
[plain] view plain copy
-
cd . && /home/zhl/cximage599c/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,难道一定要切换到低版本?
[plain] view plain copy
-
rpm -aq | grep automake automake-1.13.4-3.el7.noarch
尝试手动修改Makefile里面aclocal的版本号,仍然有问题。最后发现重新生成 aclocal.m4和Makefile就可以了:
解决步骤如下:
[plain] view plain copy
-
#重新生成 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
解决方法:修改代码 ./cximage/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
时间: 2024-12-29 07:32:40