在 Windows-Subsystem for Linux 上安装 libgraph 库时找不到 -lgraph 错误

在 Windows-Subsystem for Linux 上安装 libgraph 库时找不到 -lgraph 错误

正如标题所说,我目前无法在 Ubuntu 上安装 libgraph 库。我使用的是 Ubuntu 20.04,并按照几个指南安装这个库。但我总是得到同样的错误:

/usr/bin/install -c -m 644 './setbkcolor.3' '/usr/local/man/man3/setbkcolor.3'
 /usr/bin/install -c -m 644 './closegraph.3' '/usr/local/man/man3/closegraph.3'
 /usr/bin/install -c -m 644 './getfontcolor.3' '/usr/local/man/man3/getfontcolor.3'
 /usr/bin/install -c -m 644 './lineto.3' '/usr/local/man/man3/lineto.3'
 /usr/bin/install -c -m 644 './setcolor.3' '/usr/local/man/man3/setcolor.3'
 /usr/bin/install -c -m 644 './delay.3' '/usr/local/man/man3/delay.3'
 /usr/bin/install -c -m 644 './getgraphmode.3' '/usr/local/man/man3/getgraphmode.3'
 /usr/bin/install -c -m 644 './setfontcolor.3' '/usr/local/man/man3/setfontcolor.3'
 /usr/bin/install -c -m 644 './detectgraph.3' '/usr/local/man/man3/detectgraph.3'
 /usr/bin/install -c -m 644 './getmaxcolor.3' '/usr/local/man/man3/getmaxcolor.3'
 /usr/bin/install -c -m 644 './setgraphmode.3' '/usr/local/man/man3/setgraphmode.3'
 /usr/bin/install -c -m 644 './drawpoly.3' '/usr/local/man/man3/drawpoly.3'
 /usr/bin/install -c -m 644 './getmaxmode.3' '/usr/local/man/man3/getmaxmode.3'
 /usr/bin/install -c -m 644 './textheight.3' '/usr/local/man/man3/textheight.3'
 /usr/bin/install -c -m 644 './ellipse.3' '/usr/local/man/man3/ellipse.3'
 /usr/bin/install -c -m 644 './getmaxx.3' '/usr/local/man/man3/getmaxx.3'
 /usr/bin/install -c -m 644 './textwidth.3' '/usr/local/man/man3/textwidth.3'
 /usr/bin/install -c -m 644 './fillellipse.3' '/usr/local/man/man3/fillellipse.3'
 /usr/bin/install -c -m 644 './getmaxy.3' '/usr/local/man/man3/getmaxy.3'
 /usr/bin/install -c -m 644 './moverel.3' '/usr/local/man/man3/moverel.3'
 /usr/bin/install -c -m 644 './fillpoly.3' '/usr/local/man/man3/fillpoly.3'
 /usr/bin/install -c -m 644 './getmodename.3' '/usr/local/man/man3/getmodename.3'
 /usr/bin/install -c -m 644 './moveto.3' '/usr/local/man/man3/moveto.3'
 /usr/bin/install -c -m 644 './floodfill.3' '/usr/local/man/man3/floodfill.3'
 /usr/bin/install -c -m 644 './getmoderange.3' '/usr/local/man/man3/getmoderange.3'
 /usr/bin/install -c -m 644 './outtext.3' '/usr/local/man/man3/outtext.3'
 /usr/bin/install -c -m 644 './getpixel.3' '/usr/local/man/man3/getpixel.3'
 /usr/bin/install -c -m 644 './outtextxy.3' '/usr/local/man/man3/outtextxy.3'
 /usr/bin/install -c -m 644 './graphicstext.3' '/usr/local/man/man3/graphicstext.3'
 /usr/bin/install -c -m 644 './genellipse.3' '/usr/local/man/man3/genellipse.3'
 /usr/bin/install -c -m 644 './setlinestyle.3' '/usr/local/man/man3/setlinestyle.3'
 /usr/bin/install -c -m 644 './getlinesettings.3' '/usr/local/man/man3/getlinesettings.3'
test -z "/usr/local/man/man7" || mkdir -p -- . "/usr/local/man/man7"
 /usr/bin/install -c -m 644 './libgraph.7' '/usr/local/man/man7/libgraph.7'
 /usr/bin/install -c -m 644 './grconstants.7' '/usr/local/man/man7/grconstants.7'
make[4]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2/doc/man'
make[3]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2/doc/man'
make[3]: Entering directory '/mnt/c/C Libraries/libgraph-1.0.2/doc'
make[4]: Entering directory '/mnt/c/C Libraries/libgraph-1.0.2/doc'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2/doc'
make[3]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2/doc'
make[2]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2/doc'
make[2]: Entering directory '/mnt/c/C Libraries/libgraph-1.0.2'
Makefile:934: warning: overriding recipe for target 'libgraph.pc'
Makefile:409: warning: ignoring old recipe for target 'libgraph.pc'
/bin/bash ./libtool --mode=link gcc -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DFONTDIR=\""/usr/local/share/libgraph/Font/"\" -g -O2 -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -o libguile-libgraph.la -rpath /usr/local/lib -version-info 0:2:0 -export-dynamic -pthread  -lguile -lltdl -lgmp -lcrypt -lm -lltdl   guile-libgraph.lo -lgraph -lm -lSDL_image -L/usr/lib/x86_64-linux-gnu -lSDL
gcc -shared  .libs/guile-libgraph.o  -Wl,--rpath -Wl,/usr/lib/x86_64-linux-gnu -Wl,--rpath -Wl,/usr/lib/x86_64-linux-gnu -pthread -lguile -lgmp -lcrypt /usr/lib/x86_64-linux-gnu/libltdl.so -lgraph -lm -lSDL_image -L/usr/lib/x86_64-linux-gnu -lSDL  -Wl,-soname -Wl,libguile-libgraph.so.0 -o .libs/libguile-libgraph.so.0.0.2
/usr/bin/ld: cannot find -lgraph
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:379: libguile-libgraph.la] Error 1
make[2]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2'
make[1]: *** [Makefile:552: install-recursive] Error 1
make[1]: Leaving directory '/mnt/c/C Libraries/libgraph-1.0.2'
make: *** [Makefile:816: install] Error 2
root@DESKTOP-RF77BCQ:/mnt/c/C Libraries/libgraph-1.0.2#
root@DESKTOP-RF77BCQ:/mnt/c/C Libraries/libgraph-1.0.2# sudo cp /usr/local/lib/libgraph.* /usr/lib

感谢您的帮助

答案1

我不熟悉 libgraph,但你的问题似乎在于,无论你正在构建什么,对于链接过程,你都假设 libgraph 已经存在于你的库目录中。

您是否尝试过使用在线教程? https://seitcg.blogspot.com/2015/03/how-to-install-libgraph-on-ubuntu.html 我希望按照这里显示的步骤可以解决您的问题。

希望这可以帮助!

相关内容