Link to home
Start Free TrialLog in
Avatar of naseeam
naseeamFlag for United States of America

asked on

Why build success when lib linked and lib files compiled ?

I'm using Keil uVision version 4.73.  In my Options for Target I select RTX Kernel Operating System.  This selection will add following to the Linker Control String in the Linker Tab:

C:\Keil\ARM\RV31\LIB\RTX_ARM_L.LIB
This means this operating system library will be linked when I build my project.  In addition to linking this library, I have added all files used to create this library to my project as follows:

rt_Event.c
HAL_ARM.c
...

These files are in  C:\Keil\ARM\RL\RTX\SRC\ARM  folder.

Why does my build work ?   I'm including same Operating System twice.  Shouldn't I get re-defined symbols ?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of naseeam

ASKER

>> there are no dependencies to resolve
I want to make sure I understand.  If I call foo ( ) from my code, and foo is implemented in one of the project files, then, foo implementation from my project file will be part of executeable.  Identical Foo implementation from library file will be ignored ?
Yes, that's exactly it. Code from static libraries will only be used on a 'as needed' basis. Never will the entire library be added to your executable (well unles really all functions are used).
Avatar of naseeam

ASKER

Very Fast and useful response.  Great explanation of follow-up question.