Error in ImageMagick linking on SnowLeopard

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
meraj ansari

Error in ImageMagick linking on SnowLeopard

Post by meraj ansari »

Hi,

I am currently working on Qt/Image Magick project. But I am not able to create sample project on mac OS X snow leopard. I have downloaded Image Magick binary from website "http://www.imagemagick.org/www/binary-releases.html" . After installing it, i have added header include path "/opt/local/include" in Xcode's header search path and "/opt/local/lib" as library search path. Also i copied "libMagick++.3.dylib", "libMagickCore.3.dylib" and "libMagickWand.3.dylib" in my Xcode project. Compilation is fine but linking is showing following warnings -

ld: warning: in /Qt_Project/libMagick++.3.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /Qt_Project/libMagickCore.3.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

ld: warning: in /Qt_Project/libMagickWand.3.dylib, file was built for unsupported file format which is not the architecture being linked (i386)

and following errors-
"Magick::InitializeMagick(char const*)", referenced from:_main in main.o

"Magick::Image::~Image()", referenced from: _main in main.o

"Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: _main in main.o

ld: symbol(s) not found
collect2: ld returned 1 exit status


I used file command with dylib -file /opt/local/lib/libMagick++.3.dylib
and it is showing -
/opt/local/lib/libMagick++.3.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I guessed i am linking with wrong dylib.

My Questions are-
1- How to get right installer for mac OS X snowleopard?
2- Name of the dylibs to include in project?
3- Do i need different installer for mac OS 10.5?

Please help me as i am running out of time.
Any sample project will be more helpful.

Thanks
blackhaz

Re: Error in ImageMagick linking on SnowLeopard

Post by blackhaz »

Hi all,

Same problem here:

iMac-24:lib maximusatov$ file libMagick++.4.dylib
libMagick++.4.dylib: Mach-O 64-bit dynamically linked shared library x86_64

g++ -c -pipe -g -gdwarf-2 -arch i386 -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.6/mkspecs/macx-g++ -I../DStation -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/usr/include -I/opt/include/ImageMagick -I. -I. -I../DStation -I. -F/Library/Frameworks -o dstation.o ../DStation/dstation.cpp
g++ -headerpad_max_install_names -arch i386 -o DStation.app/Contents/MacOS/DStation main.o dstation.o moc_dstation.o -F/Library/Frameworks -L/Library/Frameworks -L/opt/lib -lMagick++ -framework QtGui -framework QtCore
ld: warning: in /opt/lib/libMagick++.dylib, file was built for unsupported file format which is not the architecture being linked (i386)
Undefined symbols:
...

Any ideas?

Thank you!
blackhaz

Re: Error in ImageMagick linking on SnowLeopard

Post by blackhaz »

This has been resolved.

Mac OSX version of Qt SDK by default includes 32-bit version of the Qt Framework. Downloaded 64-bit Qt Framework, changed my application's architecture to x86_64 and everything works fine.
Post Reply