Mac Lion 上架构 x86_64 ImageMagick 的未定义符号
在 Mac Lion 上,我已经配置、制作并安装了 ImageMagick 的静态版本。一切都很顺利,配置后我得到了
configuring ImageMagick 6.7.2-4 checking build system type... x86_64-apple-darwin11.1.0 checking host system type... x86_64-apple-darwin11.1.0 checking target system type... x86_64-apple-darwin11.1.0 ....
但是当我尝试在自己的应用程序中使用静态库时,链接器向我发送了数百个链接错误,例如...
Undefined symbols for architecture x86_64: "_XOpenDisplay", referenced from: _RenderType in libMagickCore.a(magick_libMagickCore_la-annotate.o) _DisplayImages in libMagickCore.a(magick_libMagickCore_la-display.o) ... "_XInitImage", referenced from: _ReadXWDImage in libMagickCore.a(magick_libMagickCore_la-xwd.o) ld: symbol(s) not found for architecture x86_64
这是我的 LIBS 声明,
LIBS += -L/Library/ImageMagick-6.7.2-4/magick/.libs \ -L/Library/ImageMagick-6.7.2-4/magick \ -L/Library/ImageMagick-6.7.2-4/wand/.libs \ -L/Library/ImageMagick-6.7.2-4/wand \ -L/usr/X11/lib \ -R/usr/X11/lib \ -L/opt/local/lib \ -L/opt/lib \ -lMagick++ \ -lMagickCore \ -lMagickWand \ -ltiff \ -lfreetype \ -ljpeg \ -ljasper -lpng14 -lbz2 -lz -lm -lpthread
我不太确定是什么出了问题或缺少什么。
On Mac Lion I have done a configure, make and install a static version of ImageMagick. All went fine and as result of configure I get
configuring ImageMagick 6.7.2-4 checking build system type... x86_64-apple-darwin11.1.0 checking host system type... x86_64-apple-darwin11.1.0 checking target system type... x86_64-apple-darwin11.1.0 ....
But when I am trying to use the static library in my own application, the linker send me hundreds of link error such as...
Undefined symbols for architecture x86_64: "_XOpenDisplay", referenced from: _RenderType in libMagickCore.a(magick_libMagickCore_la-annotate.o) _DisplayImages in libMagickCore.a(magick_libMagickCore_la-display.o) ... "_XInitImage", referenced from: _ReadXWDImage in libMagickCore.a(magick_libMagickCore_la-xwd.o) ld: symbol(s) not found for architecture x86_64
Here is my LIBS declaration
LIBS += -L/Library/ImageMagick-6.7.2-4/magick/.libs \ -L/Library/ImageMagick-6.7.2-4/magick \ -L/Library/ImageMagick-6.7.2-4/wand/.libs \ -L/Library/ImageMagick-6.7.2-4/wand \ -L/usr/X11/lib \ -R/usr/X11/lib \ -L/opt/local/lib \ -L/opt/lib \ -lMagick++ \ -lMagickCore \ -lMagickWand \ -ltiff \ -lfreetype \ -ljpeg \ -ljasper -lpng14 -lbz2 -lz -lm -lpthread
I am not really sure what is going wrong or what is missing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个编译问题,因为
XOpenDisplay
是X
的一部分。只需在 LIBS 声明中包含库-lX11
即可。This is a compile problem as
XOpenDisplay
is apart ofX
. Simply include the library-lX11
in your LIBS declaration.