Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Compile/load problem with graphics library



I am making a bit of progress. I changed the makefile to the "correct" version, as below. Then I managed to install everything on this computer here, and my program compiled successfully (i.e. I "made" imagetrim). Haven't tried running it yet, since the arguments are a bit fiddly, as it normally gets called from a PHP script.

So if it's a version problem, would this show up as a "can't find (function) read" message? How would I check the currently installed g++ version against the version the library was compiled with? Is it plausible that for everyone except me the library is functioning normally? I'm trying to work out whether and how to approach the hosting company pair.com with an "issue", in such a way that they can be expected to mend it.

The next simplest answer would be to install a copy of the Magick++ library which I compile myself on the server. I installed it on my computer using sudo apt-get, which doesn't appear to be an option on a shared server. Any suggestions?

I'm trying to avoid going further down the chain of workaround, but thanks for the other suggestions. I also suspect that doing pixel crunching in PHP could just be unreasonable, as there are some other more complex projects in the pipeline.

Brian Chandler

oh, here's the makefile:

----------------------------------------------------
CC=g++
CFLAGS=-c `Magick++-config --cxxflags --cppflags`
LDFLAGS=`Magick++-config --ldflags`
LDLIBS=`Magick++-config --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 $(LDLIBS) -o $@

cutpng: cutpng.o cutoutbg.o boundingbox.o bgp.h local.h
	$(CC) $(LDFLAGS) cutpng.o cutoutbg.o boundingbox.o $(LDLIBS) -o $@

test: test.o cutoutbg.o boundingbox.o
	$(CC) $(LDFLAGS) test.o cutoutbg.o boundingbox.o $(LDLIBS) -o $@

imagetrim: imagetrim.o boundingbox.o
	$(CC) $(LDFLAGS) imagetrim.o boundingbox.o $(LDLIBS) -o $@

.cpp.o:
	$(CC) $(CFLAGS) $< -o $@

clean:
	rm -rf *o
----------------------------------------------------


On 2018-08-08 10:55, Jim Tittsler wrote:
On 2018-08-08 04:49 AM, Brian Chandler wrote:
I may not have mentioned: this program has been compiled several times,
and was running for more than 3 years. So it seems unlikely that I made
a fundamental mistake. I got the response about object order on the
magick forum too; I have tried putting the configure script which
generates the library references after the .o files, but it makes no
difference.

Do you have access to multiple versions of g++?  There was a significant
change between g++ 4.9 and 5.x.  Perhaps the library was built for the
g++ you aren't using.





Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links