Problems compiling and linking ImageMagick on solaris 10

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
lsag02

Problems compiling and linking ImageMagick on solaris 10

Post by lsag02 »

I have several unresolved externals when compiling and linking sample app that uses ImageMagick. Can someone point me what the problem is.

-bash-3.00$ g++ -I /usr/local/ImageMagick-6.3.7/include `/usr/local/ImageMagick-6.3.7/bin/Magick++-config --cxxflags --cppflags` -o ./IM_Sample ./IM_Sample.cpp
In file included from IM_Sample.cpp:21:
Undefined first referenced
symbol in file
Magick::Image::read(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)/var/tmp//ccXlZDYW.o
Magick::Image::quality(unsigned) /var/tmp//ccXlZDYW.o
Magick::Geometry::Geometry[in-charge](unsigned, unsigned, unsigned, unsigned, bool, bool)/var/tmp//ccXlZDYW.o
typeinfo for Magick::Exception /var/tmp//ccXlZDYW.o
Magick::Geometry::~Geometry [in-charge]()/var/tmp//ccXlZDYW.o
Magick::Image::size() const /var/tmp//ccXlZDYW.o
Magick::Image::Image[in-charge]() /var/tmp//ccXlZDYW.o
Magick::Image::~Image [in-charge]() /var/tmp//ccXlZDYW.o
Magick::Image::zoom(Magick::Geometry const&)/var/tmp//ccXlZDYW.o
Magick::Image::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)/var/tmp//ccXlZDYW.o
ld: fatal: Symbol referencing errors. No output written to ./IM_Sample
collect2: ld returned 1 exit status

If I explicitly link the app with Magick and Magick++ i get this

-bash-3.00$ g++ -L/usr/local/ImageMagick-6.3.7/lib -lMagick -lMagick++ -I /usr/local/ImageMagick-6.3.7/include `/usr/local/ImageMagick-6.3.7/bin/Magick++-config --cxxflags --cppflags` -o ./IM_Sample ./IM_Sample.cpp
In file included from IM_Sample.cpp:21:
Undefined first referenced
symbol in file
std::_List_node_base::hook(std::_List_node_base*)/usr/local/ImageMagick-6.3.7/lib/libMagick++.so
std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage/usr/local/ImageMagick-6.3.7/lib/libMagick++.so
__gnu_cxx::__exchange_and_add(int volatile*, int)/usr/local/ImageMagick-6.3.7/lib/libMagick++.so
ld: fatal: Symbol referencing errors. No output written to ./IM_Sample
collect2: ld returned 1 exit status
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problems compiling and linking ImageMagick on solaris 10

Post by magick »

This is the standard build command for Magick++:
  • g++ `Magick++-config --cxxflags --cppflags` -o IM_Sample IM_Sample.cpp `Magick++-config --ldflags --libs`
If that fails to link, can you download / install the latest ImageMagick release 6.5.0 and try again?
Post Reply