更新时间:2022-05-24 18:24:46
在Linux中,您可以:
In Linux you can:
1)静态链接依赖项
或
2)打包依赖项Windows样式和设置环境变量LD_LIBRARY_PATH指向包含动态库的子目录
2) pack dependencies windows-style and set environment variable LD_LIBRARY_PATH pointing to the subdirectory containing the dynamic libraries
[更新]
read man ld
,如果您未默认编译静态版本的库,则可能必须编译这些库的静态版本(看看本教程是否无法分辨出差异)。
read man ld
, may be you will have to compile static versions of the libraries if they are not compiled by default (look at this tutorial if you can't tell the difference).
synthesizerpatel的好评论,如果该库使用autoconf(很多linux软件都使用autoconf),它具有--enable-shared和--enable-static之类的选项。
Great comment by synthesizerpatel, if the library uses autoconf (a lot of linux software do), it has options like --enable-shared and --enable-static.