Magick++ Namespace

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Archeleus

Magick++ Namespace

Post by Archeleus »

Hello, sorry if I missed the introductions thread but I'm Archeleus and I like tits.

Anyway short question here, I've installed ImageMagick and Magick++ which comes with it on my system, Debian Linux and also tried it on Ubuntu Debian, and I can get the include in eclipse with

Code: Select all

#include <ImageMagick/Magick++.h>
But when I try

Code: Select all

using namespace Magick
it tells me that there is no such namespace.

I kind of suspect my config file for this, but what do you guys think?

Cheers.
Archeleus

Re: Magick++ Namespace

Post by Archeleus »

I managed to fix that issue. Just some broken packages lying around that confused it.

Now I've another problem. The linker doesn't seem to want to link.

I'm getting shitloads of "Undefined Reference" errors.

Here are the commands that it used :

Code: Select all

g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
g++  -o"magick"  ./main.o   
Whenever I had past issues like this I had to add something to the linker. So can anyone of you please tell me what I should add?

EDIT :

My code :

Code: Select all

#include <iostream>
#include <ImageMagick/Magick++.h>
using namespace std;
using namespace Magick;

int main(int argc, char **argv){
	Image this_image("10x10");
	return 0;
}
Errors :

Code: Select all

make all 
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
Finished building: ../main.cpp
 
Building target: imagemagick_test
Invoking: GCC C++ Linker
g++ -L/usr/include/ImageMagick/Magick++ -o"imagemagick_test"  ./main.o   
./main.o: In function `main':
../workspace/imagemagick_test/Debug/../main.cpp:14: undefined reference to `Magick::Image::Image(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../workspace/imagemagick_test/Debug/../main.cpp:15: undefined reference to `Magick::Image::~Image()'
../workspace/imagemagick_test/Debug/../main.cpp:14: undefined reference to `Magick::Image::~Image()'
collect2: ld returned 1 exit status
make: *** [imagemagick_test] Error 1
Archeleus

Re: Magick++ Namespace

Post by Archeleus »

Bump.
Post Reply