
Ich habe ein Programm namens vmed aus seinem Quellcode mithilfe von Makefile kompiliert. Wenn ich make ausführe, läuft die Kompilierung fehlerfrei ab. Wenn ich jedoch versuche, das Programm auszuführen, erhalte ich folgenden Fehler:
./vmed: error while loading shared libraries: libpgplot.so: cannot open shared object file: No such file or directory
Ich habe pgplot plot bereits installiert. Außerdem sind die folgenden libX11.so-Pakete auf meinem Ubuntu 1904 installiert:
shah@shah-VBox:~$ apt-file search libX11.so
libx11-6: /usr/lib/x86_64-linux-gnu/libX11.so.6
libx11-6: /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
libx11-dev: /usr/lib/x86_64-linux-gnu/libX11.so
nxagent: /usr/lib/x86_64-linux-gnu/nx/X11/libX11.so.6
nxagent: /usr/lib/x86_64-linux-gnu/nx/X11/libX11.so.6.3.0
Kann mir jemand den richtigen Weg weisen und sagen, was ich falsch mache? Nachfolgend finden Sie die Make-Datei für das Programm.
#
# Makefile for vmed
#
EXEDIR=/usr/local/vmed/
#EXEDIR=/mn/vann/it-scratch/gfprog/VMED/
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
#
FC = gfortran
CFLAGS = -O
FFLAGS = -O4 -ffixed-line-length-132
X11LIB = -lX11
#PGLIB = -L/mn/geologi/gfgruppe-prog/PGPLOT -lpgplot
UCBLIB =
LIB = -L/usr/lib -lpng
PGLIB = -L/usr/local/pgplot -lpgplot
LDLIBS = $(PGLIB) $(X11LIB) $(UCBLIB) $(LIB) -lm
#
#---------------------------------------------------------------------------
#
# Source objects. If your compiler cannot find the functions
# "date_and_time" and "lnblnk", then add datetime.o and lnblnk.o
# to the list of objects below.
#
VMED_OBJS= main.o getvpar.o vmed_axis.o vmed_plotmod.o \
vmed_util.o vmed_colorize.o vmed_vcontrast.o vmed_lvz.o \
vmed_cursor.o vmed_twtt.o vmed_1d.o chleng.o \
vmed_buttons.o vmed_help.o \
vmed_cursubs.o vmed_butsubs.o plot.o ri2grid.o \
contour.o vmed_edit.o vmed_editsubs.o writeriv.o
#
# Executable name
#
VMED_EXEC=$(EXEDIR)vmed
#
all: main
main: $(VMED_OBJS)
$(FC) -o main ${VMED_OBJS} -lX11 $(LDLIBS)
mv main ${VMED_EXEC}
# dependencies
#
contour.o : rayinvr.par rayinvr.com
getvpar.o : rayinvr.par rayinvr.com
main.o : rayinvr.par rayinvr.com
ri2grid.o : rayinvr.par rayinvr.com
vmed_1d.o : rayinvr.par rayinvr.com
vmed_butsubs.o : rayinvr.par rayinvr.com
vmed_colorize.o : rayinvr.par rayinvr.com
vmed_cursor.o : rayinvr.par rayinvr.com
vmed_cursubs.o : rayinvr.par rayinvr.com
vmed_edit.o : rayinvr.par rayinvr.com
vmed_editsubs.o : rayinvr.par rayinvr.com
vmed_lvz.o : rayinvr.par rayinvr.com
vmed_plotmod.o : rayinvr.par rayinvr.com
vmed_twtt.o : rayinvr.par rayinvr.com
vmed_util.o : rayinvr.par rayinvr.com
vmed_vcontrast.o : rayinvr.par rayinvr.com
writeriv.o : rayinvr.par rayinvr.com
Antwort1
Ich habe PGPLOT zuvor ohne große Probleme auf meinen Ubuntu-Rechnern installiert. Stellen Sie sicher, dass Sie die LD_LIBRARY_PATH
Umgebungsvariable auf „wo libpgplot.so
ist“ eingestellt haben.