What is a file with extension .a?

前端 未结 2 1975
抹茶落季
抹茶落季 2020-12-04 14:03

I downloaded this: https://github.com/mongodb/mongo-c-driver

And now I\'m trying to use it inside my C program, but I don\'t know what to do with the generated .a fi

2条回答
  •  粉色の甜心
    2020-12-04 14:42

    .a files are created with the ar utility, and they are libraries. To use it with gcc, collect all .a files in a lib/ folder and then link with -L lib/ and -l.

    Collection of all .a files into lib/ is optional. Doing so makes for better looking directories with nice separation of code and libraries, IMHO.

提交回复
热议问题