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