Problem linking Magick++ with gcc - undefined reference.
Posted: 2010-02-23T12:19:38-07:00
I am trying to link my program with ImageMagick libs. I ran configure and then "make install". I am trying to statically link the libraries and the linker can find the libraries. The nm command shows that the symbols are in the libraries but I still cannot link. Every call into ImageMagick is met with an undefined reference.
: undefined reference to `Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
: undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, unsigned int, unsigned int, bool, bool)'
: undefined reference to `Magick::Image::zoom(Magick::Geometry const&)'
: undefined reference to `Magick::Geometry::~Geometry()'
: undefined reference to `Magick::Image::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
: undefined reference to `Magick::Image::~Image()'
The sample programs built and ran so I am sure the compiler is fine. gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
Here is my link line:
linking @g++ -static -Wl,--allow-multiple-definition -L../utils/lib/release -L./bin/release -L../lib -L/usr/X11R6/lib -lMagick++ -lMagickCore -lMagickWand -lfreetype -lfontconfig -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lpthread -o bin/release/CmdLineClient ./obj/release/ImageMagick.o ./obj/release/CmdLineClient.o
Any help is greatly appreciated!!
Thanks,
Waffle
: undefined reference to `Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
: undefined reference to `Magick::Geometry::Geometry(unsigned int, unsigned int, unsigned int, unsigned int, bool, bool)'
: undefined reference to `Magick::Image::zoom(Magick::Geometry const&)'
: undefined reference to `Magick::Geometry::~Geometry()'
: undefined reference to `Magick::Image::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
: undefined reference to `Magick::Image::~Image()'
The sample programs built and ran so I am sure the compiler is fine. gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
Here is my link line:
linking @g++ -static -Wl,--allow-multiple-definition -L../utils/lib/release -L./bin/release -L../lib -L/usr/X11R6/lib -lMagick++ -lMagickCore -lMagickWand -lfreetype -lfontconfig -ldpstk -ldps -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lpthread -o bin/release/CmdLineClient ./obj/release/ImageMagick.o ./obj/release/CmdLineClient.o
Any help is greatly appreciated!!
Thanks,
Waffle