Apps :: More questions regarding compiling extensions



Ok, so I have compiled my library so that it is now in /opt/gnuplot/lib/....

I gather I don't need the *.a files or the includes for a .tar.gz, just the libgd.so's

Now going to recopile gnuplot to see if can make it find the libraries.

Ok gnuplot now recognizes where the libraries are during the compile process but when I run gnuplot it can't find them.

Any feedback welcome

cheers phil

That's exactly the issue I was talking about. I'm sure there's a way to build the program to find the libs automatically at runtime, but I don't know how t do it. When I compile apps that need extra libs I just hope the program compiles that way, and if not i write a wrapper:
Code Sample
#!/bin/bash
export LD_LIBRARY_PATH="/opt/gnuplot/lib:$LD_LIBRARY_PATH"
exec /opt/gnuplot/bin/gnuplot

And then run the wrapper instead of directly running gnuplot

Cool, thanks mikshaw, I will try that!

Yes! It works.

Ok, so now to use a wrapper I will have to move from a .tar.gz to a .UCI or .UNC?

Thanks heaps. Once again I can goto bed

Cheers Phil

OK, I am awake again.

Still working through this issue.

Here are snippets of code from the 'make' output, with and without the library option.

More info: extraction from the make output with the --with-gd

g++  -g -O2  -L/opt/gnuplot/lib -o gnuplot  alloc.o axis.o breaders.o
bitmap.o color.o command.o contour.o datafile.o dynarray.o eval.o
fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o
history.o internal.o interpol.o matrix.o misc.o mouse.o parse.o plot.o
plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o
specfun.o standard.o stdfn.o tables.o term.o time.o unset.o util.o
util3d.o variable.o version.o   -lreadline  -lncurses  -lz -lgd  -
ljpeg -lfreetype -lpng   -lm

extraction from the make output without the --with-gd

g++  -g -O2   -o gnuplot  alloc.o axis.o breaders.o bitmap.o color.o
command.o contour.o datafile.o dynarray.o eval.o fit.o gadgets.o
getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o
interpol.o matrix.o misc.o mouse.o parse.o plot.o plot2d.o plot3d.o
pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o
stdfn.o tables.o term.o time.o unset.o util.o util3d.o variable.o
version.o   -lreadline  -lncurses  -lz   -lm

I was wondering if maybe the library command was not correct, maybe it should be


g++  -g -O2  LDFLAGS=-L/opt/gnuplot/lib -o gnuplot  alloc.o axis.o
breaders.o ect..

rather than g++  -g -O2  -L/opt/gnuplot/lib -o gnuplot  alloc.o axis.o
breaders.o etc..

Thanks Phil

Nah, the LDFLAGS=-/L etc isn't right from what I can see in reference material on the web.

However, I did find that if I copy the files to the /opt/gnuplot directory, the program finds them when run from /opt/gnuplot/bin. Very strange.

Maybe I need to do something different when I compile the libraries?

I don't know ???

regards Phil

Next Page...
original here.