how to compile .a lib and .so li

作者: dopami | 来源:发表于2018-04-14 20:46 被阅读69次

    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

    相关文章

      网友评论

        本文标题:how to compile .a lib and .so li

        本文链接:https://www.haomeiwen.com/subject/wwcrkftx.html