关于GCC将多个LIB打包成一个的问题
各位大虾:
目前我手头有这么一个需求:我们需要开发一些功能以LIB的形式发布给客户,以便客户进行二次开发。现在我们会有很多个LIB,我想找包成一个LIB, 但是发现在链接的时候报错: could not read symbols: Archive has no index; run ranlib to add one。
请问各位有什么好办法没?
我实验的命令如下:
$ mips-elf-gcc -static -c test1.c
$ mips-elf-gcc -static -c test2.c
$ mips-elf-ar qs libtest2.a test2.o
$ mips-elf-ar qs libtest1.a test1.o
$ mips-elf-ar qs liball.a libtest1.a libtest2.a
$ mips-elf-ranlib liball.a
$ mips-elf-ld -nostdlib -L/cygdrive/d/gcc_test/ -lall -Map all.map
/cygdrive/d/gcc_test//liball.a: could not read symbols: Archive has no index; ru
n ranlib to add one
目前我手头有这么一个需求:我们需要开发一些功能以LIB的形式发布给客户,以便客户进行二次开发。现在我们会有很多个LIB,我想找包成一个LIB, 但是发现在链接的时候报错: could not read symbols: Archive has no index; run ranlib to add one。
请问各位有什么好办法没?
我实验的命令如下:
$ mips-elf-gcc -static -c test1.c
$ mips-elf-gcc -static -c test2.c
$ mips-elf-ar qs libtest2.a test2.o
$ mips-elf-ar qs libtest1.a test1.o
$ mips-elf-ar qs liball.a libtest1.a libtest2.a
$ mips-elf-ranlib liball.a
$ mips-elf-ld -nostdlib -L/cygdrive/d/gcc_test/ -lall -Map all.map
/cygdrive/d/gcc_test//liball.a: could not read symbols: Archive has no index; ru
n ranlib to add one
...全文
相关推荐
arm-linux-gcc-3.4.1.tgz
对于想把嵌入式学好的人,这个真的很有用,分享了给你好好学习吧
DLL导出LIB工具详解与实战应用
MinGW是一个用于Windows的GNU工具链,它允许开发者使用GCC(GNU Compiler Collection)来编译Windows原生应用程序,而无需依赖第三方运行时库。MinGW支持C、C++等多种语言,并提供了Windows API的头文件和链接库。MSYS是Minimal System的缩写,它是一个轻量级的Unix Shell环境,基于Cygwin但更轻便。MSYS提供了一个命令行终端,支持常见的Unix命令如lscpmake。
QT交叉编译ARM架构下的程序打包时常缺少的.so库
涵盖了QT交叉编译ARM架构程序,在手动打包的时候常缺少的.so库,直接拷贝到打包的lib目录下即可解决缺少库的问题。
静态库的实例
静态库,LIB,编译通过的实用例子,适合初学者学习
如何编写Linux Makefile文件
如何编写Linux Makefile文件


