how to compile .a lib and .so lib in linux

github address:

https://github.com/hongrui16/hello_compile


## This repository shows how to create a static library and a dynamic library with GCC and Makefile.The repository contains two project.

'helloA' shows you how to create a static library and a dynamic library with source code.

While 'helloAplus' shows you how to create a dynamic library with a static library.

what is more, i found that u can still use function in the static though it has been packaged to a dynamic library.

In addition, when u run the test demo, such as demoso. 'demoso' means it generated by using a dynamic library. It will warn that the library can not be found.

To solve this, u shall set LD_LIBRARY_PAHT to the path where the lib is stored.

### EXPORT LD_LIBRARY_PATH=$(YOUR_PATH)/lib

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容