undefined reference to `Magick.. when compiling my code

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
Sameh
Posts: 2
Joined: 2011-12-09T12:30:40-07:00
Authentication code: 8675308

undefined reference to `Magick.. when compiling my code

Post by Sameh »

I'm trying to compile GPUSURF64 library which depends on ImageMagick but it gives me an error:

Code: Select all

sameh@sameh-pc:~/GPUSURF64/gpusurf$ sudo make
g++ -fPIC -o bin/Release/gpusurf obj/Release/src/main.cpp.o   -L../libsurf/lib/Release -lsurf -L/usr/local/cuda/lib64 -L/home/sameh/NVIDIA_GPU_Computing_SDK/C/lib -L/home/sameh/NVIDIA_GPU_Computing_SDK/C/common/lib -lcuda -lcudart -lcutil -lcublas -L../libncgl/lib/Release -lncgl -L/usr/lib -lglut -L/usr/lib -lGLEW -L/usr/lib -lCg -lCgGL -L/usr/lib -lGL -lpthread -lMagick++
../libsurf/lib/Release/libsurf.a(surfobject.cpp.o): In function `SurfObject::loadImage(char const*)':
surfobject.cpp:(.text+0x8603): undefined reference to `Magick::Image::write(int, int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void*)'
../libncgl/lib/Release/libncgl.a(image.cpp.o): In function `ncglImage::write(unsigned int, unsigned int, Magick::Image*, int, bool)':
image.cpp:(.text+0x9ec): undefined reference to `Magick::Image::read(unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void const*)'
../libncgl/lib/Release/libncgl.a(image.cpp.o): In function `ncglImage::write(unsigned int, unsigned int, Magick::Blob*, int, bool, char*, int)':
image.cpp:(.text+0xc73): undefined reference to `Magick::Image::quality(unsigned int)'
../libncgl/lib/Release/libncgl.a(image.cpp.o): In function `ncglImage::load(Magick::Image*, unsigned int, unsigned int, bool)':
image.cpp:(.text+0xed8): undefined reference to `Magick::Image::write(int, int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void*)'
image.cpp:(.text+0xf6e): undefined reference to `Magick::Image::write(int, int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void*)'
image.cpp:(.text+0x1008): undefined reference to `Magick::Image::write(int, int, unsigned int, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, MagickCore::StorageType, void*)'
collect2: ld returned 1 exit status
make: *** [bin/Release/gpusurf] Error 1

GPUSURF64: http://homes.esat.kuleuven.be/~ncorneli/gpusurf/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: undefined reference to `Magick.. when compiling my code

Post by magick »

We didn't write, not do we support the GPU-Surf library.

To verify Magick++ is installed and working properly, save this codeset to a file named magick++.cpp:

Code: Select all

#include <Magick++.h>
#include <iostream>

using namespace std;

using namespace Magick;

int main( int /*argc*/, char ** argv)
{
  InitializeMagick(*argv);
  try {
    {
      // Read test image, just to have some pixels available    
      Image picture;
      picture.read("logo:");
      picture.write("logo.pnm");
    }
  } catch( Exception &error_ ) {
    cout << "Caught Exception: " << error_.what() << endl;
    return 1;
  } catch( exception &error_ ) {
    cout << "Caught exception: " << error_.what() << endl;
    return 1;
  }

  return 0;
}
Build with this command:
  • g++ `Magick++-config --cxxflags --cppflags` -O2 -Wall -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
Does the module compile? If so, ImageMagick and Magick++ are installed properly.
Sameh
Posts: 2
Joined: 2011-12-09T12:30:40-07:00
Authentication code: 8675308

Re: undefined reference to `Magick.. when compiling my code

Post by Sameh »

This module works perfectly.
I want to try GPUSURF64 on ImageMagick-6.4.5 2009-06-04 Q16, where can I find this version?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: undefined reference to `Magick.. when compiling my code

Post by magick »

You can find legacy release of ImageMagick here: http://sourceforge.net/projects/imagemagick/.
Post Reply