gpt4 book ai didi

c - 如何使用 libtool 从一堆静态库中创建一个静态库

转载 作者:太空狗 更新时间:2023-10-29 17:11:51 24 4
gpt4 key购买 nike

我有大约 80 个静态库。我想从中创建一个静态库。

This answer没有为我工作,因为我收到以下错误:

libtool: unrecognized option `-static'

我也对需要在哪种模式下完成感到困惑。是“链接”还是“安装”既然有20多个库,我也可以用“*”来指定所有吗?

我没有在文档中找到任何信息 expect this这并没有真正回答我的问题。

仅供引用..这些是模式:

MODE must be one of the following:

clean remove files from the build directory
compile compile a source file into a libtool object
execute automatically set library path, then run a program
finish complete the installation of libtool libraries
install install libraries or executables
link create a library or an executable
uninstall remove libraries from an installed directory

最佳答案

我可能天真地忽略了一些后果,但你不能直接把文件当作文件吗?

for i in *.a; ar x $i; done
ar r libfoo.a *.o
ranlib libfoo.a

当然,如果任何 .o 文件相同,您将需要某种重命名方案。可能类似于 libname_objectname.o

关于c - 如何使用 libtool 从一堆静态库中创建一个静态库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24954747/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com