C/C++ || 编译、链接、执行 || docker我爱编程

how to compile .a lib and .so li

2018-04-14  本文已影响69人  dopami

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

上一篇下一篇

猜你喜欢

热点阅读