C - static libraries

No hay texto alternativo para esta imagen

Why use libraries in C?

To make your life simple as a developer, if you do not want to spend a lot of time writing code, you can use libraries to simplify this process and make it easier for you to concentrate on logic problems rather than "referencing" standard functions.

No hay texto alternativo para esta imagen

All libraries are collections of functions that get referenced by the linker on the compilation process, at this point in the object code that you have in the process you will find there undefined references, which the linker will look up in the runtime library so it can be linked or defined.

No hay texto alternativo para esta imagen

How to make a libary you wonder? better run!!! just kidding, to make a static library you will to do a small compilation process before, you will need to create object code from the functions files that end up with ".c" to put inside the static library, for that you type the following command: gcc -c *.c this command will generate object code for every .c element taht you have on the current folder, once you got the object code for each of those files, run the following command: ar -rc liball.a *.o this command will make all the object files into a static library called "liball.a".

No hay texto alternativo para esta imagen

How to use them? Its simple, whenever you need to compile a program, define your specifics needs, if you might need a static which will belong specifically to the application that you are building, or if it is a shared library that can be used by multiple programs or application during the compilation process? let it be one or the other, we know that during compilation process, the libraries cited on the programs will be expanded and transformed into object code later on.

要查看或添加评论,请登录

Marcos Pimienta的更多文章

  • ?? Introducing GomitasAngel: A Sweet & Interactive Shopping Experience ???

    ?? Introducing GomitasAngel: A Sweet & Interactive Shopping Experience ???

    Hey everyone! I'm excited to share a project I’ve been working on: GomitasAngel. This project combines interactive 3D…

    3 条评论
  • ?? Empowering Victims of Misleading Bootcamps – A Legal Awareness Tool ????

    ?? Empowering Victims of Misleading Bootcamps – A Legal Awareness Tool ????

    Situation: In recent years, many young individuals, driven by their passion to learn programming, fell victim to…

    3 条评论
  • ????Deobfuscating Code: Unmasking the Hidden Logic

    ????Deobfuscating Code: Unmasking the Hidden Logic

    ??In the world of software development, encountering obfuscated code can be a daunting task. Whether you're a security…

  • Crypto Scams Targeting Developers

    Crypto Scams Targeting Developers

    Recently, I was targeted by a scam that was cleverly disguised as a job opportunity. I am sharing my experience to…

    7 条评论
  • DevOps Quest: The RESTome

    DevOps Quest: The RESTome

    Ascending within the celestial lighthouse, the air turned cool, a gentle breeze signaling a change. Emerging from the…

    3 条评论
  • DevOps Quest: A Tech Odyssey

    DevOps Quest: A Tech Odyssey

    Once, in the realm of computer animation, I was an artisan. My canvas was the screen, my palette consisted of pixels…

    1 条评论
  • Community Power

    Community Power

    It has been a month and a half since my education in Holberton School Medellín has finished, and with this comes a lot…

    2 条评论
  • Mentor Matching Machine (Chapter02)

    Mentor Matching Machine (Chapter02)

    Greetings I am proud to be part of a professional team called this team is composed by: David Arias(Back-End), Deyber…

  • Mentor Matching Machine (Chapter01)

    Mentor Matching Machine (Chapter01)

    I have been learning software development in Holberton School Medellín for the past year, as the final project of the…

    1 条评论
  • POSTMORTERM

    POSTMORTERM

    This a term that was brought up by the french, as a report of a deceased person, but in this case, we will talk about a…

社区洞察

其他会员也浏览了