Problems compiling and linking ImageMagick on solaris 10
Posted: 2009-03-17T08:13:38-07:00
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
-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