Libraries on Standalone arduino

Hi [newb question incoming]

Sorry for this stupid question but i have been searching the web for answers yet none have cleared it up

How are libraries implemented in standalone micro-controllers (ex standalone arduino). For example i have a library for MAX7219 and the size of this library is 13kb. But when i compile a sample program using this library it comes out to be 4000bytes or so.

How will i manage libraries in standalone micro-controllers and will they take up that much space.

Is the final compiled program size the actual size on the uC? or will i need to account for libraries.

Thanks a lot

Suppose that the max7219 library sets a digit to a specified hexadecimal value by this code

lc.setDigit(0,4,(byte)ones,false);

The compiled program is now in a binary file for microcontroller to understand. What if that binary files tells the micro-controller to operate the MAX7219 in such a way, like for example turn segment A on or segment B off. So does the compiled program already specify what pins to turn on/off and the program just follows this method using conditions?

Sorry for this newb question i am just confused a bit

i have a library for MAX7219 and the size of this library is 13kb. But when i compile a sample program using this library it comes out to be 4000kb or so.

Can you please post the sample program here and the output from the successful compilation ?

does the compiled program already specify what pins to turn on/off

Yes

But when i compile a sample program using this library it comes out to be 4000kb or so.

4 Megabytes? You certainly have a problem. An unbelievable one, if I may be so bold.

What library? What code? What Arduino?

Just realized that i wrote 4000Kb o.o sorry i meant 4000 bytes or so

When you compile a program any necessary code from a library is included. The running program will never need to refer to the source code for the library.

But maybe I have misunderstood the problem.

...R