[英]Build x86 ImageMagick application on x86_64 linux system
I have x86 C++ application which using ImageMagic++ library. 我有使用ImageMagic ++库的x86 C ++应用程序。 I also have machine with CentOS 7 x86_64.
我也有配备CentOS 7 x86_64的计算机。 I need to build my application on this machine.
我需要在这台机器上构建我的应用程序。 I have installed i686 ImageMagick library:
我已经安装了i686 ImageMagick库:
[dvoryankin@testsuitel]$ yum list installed | grep Magick
ImageMagick.i686 6.7.8.9-10.el7 @base
ImageMagick-c++.i686 6.7.8.9-10.el7 @base
ImageMagick-c++-devel.i686 6.7.8.9-10.el7 @base
ImageMagick-devel.i686 6.7.8.9-10.el7 @base
When I try to build my application I have an error: 当我尝试构建我的应用程序时,出现错误:
/usr/include/ImageMagick/magick/magick-config.h:9:31:
fatal error: magick-config-64.h: No such file or directory
#include "magick-config-64.h"
It's happened becuase file /usr/include/ImageMagick/magick/magick-config.h use macro definition __WORDSIZE
to determine which file must be included magick-config-64.h or magick-config-32.h . 发生这种情况是因为文件/usr/include/ImageMagick/magick/magick-config.h使用宏定义
__WORDSIZE
来确定必须包含magick-config-64.h或magick-config-32.h的文件 。 On my machine with CentOS 7 x86_64 this macro is equal 64 and ImageMagick try to include magick-config-64.h but i686 library doesn't have this, only magick-config-32.h . 在我使用CentOS 7 x86_64的计算机上,此宏等于64,ImageMagick尝试包含magick-config-64.h,但i686库没有这个,只有magick-config-32.h 。
How I can build x86 application with x86 ImageMagick library on CentOS 7 x86_64 machine without change any library files? 如何在CentOS 7 x86_64机器上使用x86 ImageMagick库构建x86应用程序而不更改任何库文件?
I can only suggest rebuilding ImageMagick & delegates in an isolated location (not /usr/
directory). 我只能建议在一个隔离的位置(不是
/usr/
目录)重建ImageMagick和委托。
curl -O http://www.imagemagick.org/download/ImageMagick.tar.gz
tar zvxf ImageMagick.tar.gz && cd ImageMagick-6.9.2-4
CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 \
./configure --build=i686-pc-linux-gnu --prefix=/opt/im32
Provided you have everything you need for gcc to build cross-platform, and you already have all ImageMagick dependencies built in x86
. 只要您具有gcc跨平台构建所需的一切,并且您已经具有
x86
内置的所有ImageMagick依赖项。
The utility /opt/im32/bin/Magick++-config
can be used to print out the additional compiler/linker flags need for your c++ application. 可以使用
/opt/im32/bin/Magick++-config
实用程序打印出c ++应用程序所需的其他编译器/链接器标志。
也许在配置之前尝试在命令行中像CXXFLAGS ='-D __WORDSIZE = 64'一样定义__WORDSIZE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.