Code: Select all
#include "Magick++.h"
using namespace std;
using namespace Magick;
void testbild()
{
Image image;
image.read( "logo:");
Geometry newSize = Geometry(720, 480);
image.scale(newSize);
image.write( "logo.png");
}
int main(int argc, char **argv)
{
InitializeMagick(*argv);
testbild(); // OK
return 0;
}
Code: Select all
$ g++ `Magick++-config --cppflags --cxxflags --ldflags --libs` -o prova prova.cpp
/tmp/cc2BtIjx.o: In function `testbild()':
prova.cpp:8: undefined reference to `Magick::Image::Image()'
prova.cpp:9: undefined reference to `Magick::Image::read(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
prova.cpp:10: undefined reference to `Magick::Geometry::Geometry(unsigned long, unsigned long, long, long, bool, bool)'
prova.cpp:11: undefined reference to `Magick::Image::scale(Magick::Geometry const&)'
prova.cpp:12: undefined reference to `Magick::Image::write(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
prova.cpp:12: undefined reference to `Magick::Geometry::~Geometry()'
prova.cpp:12: undefined reference to `Magick::Image::~Image()'
prova.cpp:12: undefined reference to `Magick::Image::~Image()'
prova.cpp:12: undefined reference to `Magick::Geometry::~Geometry()'
/tmp/cc2BtIjx.o: In function `main':
/home/fontana/Dropbox/Luca/prova.cpp:17: undefined reference to `Magick::InitializeMagick(char const*)'
collect2: ld returned 1 exit status
Code: Select all
$ Magick++-config --cppflags --cxxflags --ldflags --libs
-I/usr/include/ImageMagick
-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -pthread
-L/usr/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -L/usr/lib/X11
-L/usr/lib -lMagick++ -lMagickWand -lMagickCore -llcms -ltiff -lfreetype -ljpeg -llqr-1 -lglib-2.0 -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread -lltdl
Code: Select all
$ ls /usr/lib/libMagick*
/usr/lib/libMagick++.a /usr/lib/libMagickCore.so /usr/lib/libMagick++.la /usr/lib/libMagick++.so.4.0.1 /usr/lib/libMagickWand.so
/usr/lib/libMagickCore.a /usr/lib/libMagickCore.so.4 /usr/lib/libMagick++.so /usr/lib/libMagickWand.a /usr/lib/libMagickWand.so.4
/usr/lib/libMagickCore.la /usr/lib/libMagickCore.so.4.0.1 /usr/lib/libMagick++.so.4 /usr/lib/libMagickWand.la /usr/lib/libMagickWand.so.4.0.1
Code: Select all
$ ls /usr/include/ImageMagick/Magick++*
/usr/include/ImageMagick/Magick++.h
/usr/include/ImageMagick/Magick++:
Blob.h CoderInfo.h Color.h Drawable.h Exception.h Geometry.h Image.h Include.h Montage.h Pixels.h STL.h TypeMetric.h