Page 1 of 1

undefined reference to `Magick.. when compiling my code

Posted: 2011-12-09T12:48:19-07:00
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/

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

Posted: 2011-12-09T13:45:38-07:00
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.

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

Posted: 2011-12-10T00:08:56-07:00
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?

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

Posted: 2011-12-10T07:45:42-07:00
by magick
You can find legacy release of ImageMagick here: http://sourceforge.net/projects/imagemagick/.