Lib files and LCF

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lib files and LCF

Jump to solution
1,078 Views
Kaare
Contributor III

I have a question that i can't really find an answer to anywhere:

 

If i compile a .lib file and include it in another project, then what about the LCF file?? The project that i compile into the lib file needs the lcf file and so does the project that i include the lib file in.

 

Now, what i wonder is this: What lcf file is the one used then? Should they be defined equally or does it only use the lcf file from the final project and thus making the lcf file in the lib project irrelevant??

Labels (1)
0 Kudos
1 Solution
640 Views
CrasyCat
Specialist III

Hello

 

I did some test son my side with CodeWarrior for MCU V10.1 build 110204

 

After I created a project using the wizard I did following modifications:

  - In ColdFire Linker> Input panel I deleted content of Link Command File and Entry Point edit boxes.

  - In ColdFire Linker> Output panel I set Output Type to Static Library.

 

I was then able to build the project and generate the static library.

 

What did you do differently?

 

CrasyCat

View solution in original post

0 Kudos
4 Replies
640 Views
stanish
NXP Employee
NXP Employee

Hi Kaare,

Actually the project that builds a library does not need a .lcf file. If you have a .lcf file in your project you can remove it since it's ignored.

Library is in fact the set of all data objects and functions in form of the object code.

When you add a library into your application then the library objects/functions referenced in the application are linked into final executable file (.elf).

The exact placement of a library object depends on a declared section (default e.g. .text or custom one e.g. .my_text) and it's controlled by the application .lcf file.

Stanish

0 Kudos
640 Views
Kaare
Contributor III

Thanks for your reply.

 

 

If i remove the project.lcf file i get this error:

 

"DescriptionResourcePathLocationTypemake: *** No rule to make target `C:/Lokale Dokumenter/Freescale/Workspace/TEOS/Project_Settings/Linker_Files/Project.lcf', needed by `TEOS.lib'.TEOSline 0C/C++ Problem"

 

 

Thats why i'm confused about the lcf file.

 

Here's my project settings (Linker output):

 

Linker output settings

 

I already tried disabling all the "generate.." options but it still gives this error.

 

0 Kudos
641 Views
CrasyCat
Specialist III

Hello

 

I did some test son my side with CodeWarrior for MCU V10.1 build 110204

 

After I created a project using the wizard I did following modifications:

  - In ColdFire Linker> Input panel I deleted content of Link Command File and Entry Point edit boxes.

  - In ColdFire Linker> Output panel I set Output Type to Static Library.

 

I was then able to build the project and generate the static library.

 

What did you do differently?

 

CrasyCat

0 Kudos
640 Views
Kaare
Contributor III

Thanks CrazyCat, that did it :smileyhappy:

 

After i removed those settings and removed all startup and exception code it compiled fine without the lcf!

0 Kudos