linux编译image,64位Linux编译cximage手记

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,难道一定要切换到低版本?

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

4、

解决后重新make,编译报其他错:

mv -f .deps/ximajbg.Tpo .deps/ximajbg.Po

g++ -DHAVE_CONFIG_H -I. -I../.. -MT ximajas.o -MD -MP -MF .deps/ximajas.Tpo -c -o ximajas.o ximajas.cpp

In file included from ximajas.h:19:0,

from ximajas.cpp:8:

../jasper/include/jasper/jasper.h:114:31: fatal error: jasper/jas_config.h: No such file or directory

#include

估计是头文件路径设置的不完整,重新configure,添加头文件路径:

# 删除原来的 Makefile

find ./ -name Makefile -exec rm -rf {} \;

# 添加--with-extra-includes指定头文件路径,重新生成Makefile

./configure --with-extra-includes=/home/cximage599c/cximage/jasper/include/

之后可以在 cximage/jasper/Makefile 中看到添加的 include 路径。

5、 再次make clean;make ,还有错误.

mv -f .deps/ximabmp.Tpo .deps/ximabmp.Po

g++ -DHAVE_CONFIG_H -I. -I../.. -I/home/cximage599c/cximage/jasper/include/ -MT tif_xfile.o -MD -MP -MF .deps/tif_xfile.Tpo -c -o tif_xfile.o tif_xfile.cpp

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));

}

6、 最后cximage编译通过,但编译自己的程序,链接cximage相关的静态库时又提示需要-fPIC选项./usr/bin/ld: /home/xxxxx/libCxImage.a(ximatran.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

/home/xxxxx/libCxImage.a: could not read symbols: Bad value

因此删除Makefile后,添加CPPFLAGS="=-fPIC" 选项,重新执行configure生成Makefile

CPPFLAGS="=-fPIC"  ./configure --with-extra-includes=/home/cximage599c/cximage/jasper/include/

编译步骤总结:

1、 修改 ./cximage/CxImage/tif_xfile.cpp 代码

2、 aclocal

3、 autoconf -i -v -f

4、 automake --add-mising

5、 find ./ -name Makefile -exec rm -rf {} \;

6、 CPPFLAGS="=-fPIC" ./configure --with-extra-includes=/home/cximage599c/cximage/jasper/include/

CPPFLAGS 根据实际需要添加。

7、 make; make install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: CXImage是一个易于使用的C++图像处理库,可以处理多种格式的图像并提供了许多图像编辑功能。如果想在Linux平台上使用CXImage,首先需要从官方网站或GitHub代码仓库下载代码。然后按照以下步骤进行: 1. 将代码解压缩到您想要存放的目录中。 2. 打开终端并进入该目录。 3. 使用make命令生成库文件。 4. 在生成的lib目录中找到生成的库文件。 5. 使用make install命令将库文件安装到系统目录中。 至此,您就可以开始在Linux平台上使用CXImage库进行图像处理了。您可以在代码中引用生成的库文件,并使用CXImage库提供的各种函数来处理不同格式的图像和编辑图像。此外,CXImage库还提供了许多示例代码,您可以使用它们来进一步了解如何使用该库。 ### 回答2: 在Linux系统下下载CXImage,可以按照以下步骤进行: 1. 打开终端,使用命令行工具。 2. 确保您的系统已经安装了Git和CMake。如果没有安装,可以使用以下命令进行安装: ``` sudo apt-get install git cmake ``` 3. 使用Git命令克隆CXImage的源代码仓库。在终端中运行以下命令: ``` git clone https://github.com/ibnudana/cximage.git ``` 4. 进入克隆下来的CXImage目录: ``` cd cximage ``` 5. 创建一个新的目录,用于构建CXImage的对象文件: ``` mkdir build cd build ``` 6. 运行CMake生成Makefile: ``` cmake .. ``` 7. 运行make命令进行编译: ``` make ``` 8. 完成编译后,在build目录中会生成cximage库文件,可以使用它来进行图像处理等操作。 以上是在Linux系统下下载CXImage的基本步骤。根据实际情况,您可能需要解决一些依赖项或配置问题。请确保您的系统满足CXImage的要求,并参考CXImage的文档进行进一步的配置和安装。 ### 回答3: 在 Linux 系统下下载 cximage 需要执行以下步骤: 1. 打开终端(Terminal),使用以下命令安装 git:sudo apt-get install git 2. 使用以下命令克隆 cximage 仓库:git clone https://github.com/Delgan/cximage.git 3. 进入 cximage 目录:cd cximage 4. 使用以下命令编译 cximage:make 5. 编译完成后,在 cximage 目录中将生成可执行文件 cximage
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值