I\'m having trouble linking my program to a library. I\'ve never done this before so I\'m probably doing something stupid, but as far as I can tell I\'m doing the right thin
Try -lbar
(or perhaps -lhealpix
, if that's the real library name).
-lxyz
results in a search for a file named libxyz.a
. Consequently, if you specify -llibbar.a
then the file needs to be named liblibbar.a.a
.
You could also simply specify the path and full name of the archive file on the gfortran command line: gfortran -o foo foo.f90 /directory/of/library/libbar.a