Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm installing lenstool which needs pgplot library so I got the source codes and followed this to install it I also ran one of it examples and it seemed to work. But when I try to make lenstool it returns this error:

/usr/bin/ld: cannot find -lpgplot
collect2: ld returned 1 exit status
make[1]: *** [Histogram] Error 1
make[1]: Leaving directory `/home/soroosh/soroosh/darkmatter/lenstool/lenstool_v6.7.1/utils'
make: *** [all-recursive] Error 1

ubuntu 12.04 lts 64 bit. and I have installed pgplot in:


Is this a linking problem? Please help me with this. tell me if other specifications are needed.

share|improve this question

migrated from Dec 2 '12 at 20:18

This question came from our site for professional and enthusiast programmers.

"ld" the dynamic library loader couldn't locate "lpgplot" library. So when you try to make "lenstool" you are missing "lpgplot". What do you mean by you've "installed" pgpplot in "/usr/local/src"? – happy coder Dec 2 '12 at 13:36
I copied the files there and ran configure and make there also once it needs a destination directory which I set on the same folder – user1414470 Dec 2 '12 at 13:43
Run it like LDFLAGS=-L/your/path/to/pgplot make – week Dec 2 '12 at 21:02
Thank you that fixed it – soroosh.strife Dec 4 '12 at 12:17

It was a linking problem, because of not standard path, linker couldn't find pgplot library. Solution is to add to LDFLAGS, parameter -L, which adds path to libraries.

LDFLAGS=-L/your/path/to/pgplot make

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .