?
Solved

Why build success when lib linked and lib files compiled ?

Posted on 2014-02-24
4
Medium Priority
?
744 Views
Last Modified: 2014-02-24
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 ?
0
Comment
Question by:naseeam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 39884343
When you have all these files in your project, there are no dependancies to resolve. A linker will only use these functions from a static library that are referenced from your code, Since there are none, the linker will not look for them in the lib file.
0
 
LVL 1

Author Comment

by:naseeam
ID: 39884398
>> 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 ?
0
 
LVL 86

Expert Comment

by:jkr
ID: 39884563
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).
0
 
LVL 1

Author Closing Comment

by:naseeam
ID: 39884606
Very Fast and useful response.  Great explanation of follow-up question.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question