Installation problem under FreeBSD
Posted: 2018-07-10T12:37:41-07:00
Can someone help me with getting Imagemagick++ to work under FreeBSD, or reinstall it? I have a small C++ program to do some basic image manipulation (basic, but very specific); it ran on my webserver (at pair.com hosting), but suddenly stopped working, because of some upgrade or other. When I tried to recompile my program, I got the following error messages:
Here's the makefile:
Someone suggested that this is a loader problem, because the library has been compiled under a different version. I thought that perhaps the simplest way around this would be to install a copy of the Imagemagick++ libary in my own space, but I simply can't see how to do this. I don't really understand what the library object file would be called, for a start.
Can anyone give me any pointers in the right direction? TIA
Code: Select all
g++ `Magick++-config --ldflags --libs` imagetrim.o boundingbox.o -o imagetrim
imagetrim.o: In function `main':
imagetrim.cpp:(.text+0x3c1): undefined reference to `Magick::Image::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
imagetrim.cpp:(.text+0x783): undefined reference to `Magick::Image::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
imagetrim.cpp:(.text+0xd55): undefined reference to `Magick::Image::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
*** Error code 1
Code: Select all
CC=g++
CFLAGS=-c `Magick++-config --cxxflags --cppflags`
LDFLAGS=`Magick++-config --ldflags --libs`
SOURCES=main.cpp hello.cpp factorial.cpp imagetrim.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=hello
all: $(SOURCES) $(EXECUTABLE)
cutout: cutout.o cutoutbg.o boundingbox.o
$(CC) $(LDFLAGS) cutout.o cutoutbg.o boundingbox.o -o $@
cutpng: cutpng.o cutoutbg.o boundingbox.o bgp.h local.h
$(CC) $(LDFLAGS) cutpng.o cutoutbg.o boundingbox.o -o $@
test: test.o cutoutbg.o boundingbox.o
$(CC) $(LDFLAGS) test.o cutoutbg.o boundingbox.o -o $@
imagetrim: imagetrim.o boundingbox.o
$(CC) $(LDFLAGS) imagetrim.o boundingbox.o -o $@
.cpp.o:
$(CC) $(CFLAGS) $< -o $@
clean:
rm -rf *o
Can anyone give me any pointers in the right direction? TIA