Lib files and LCF

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Lib files and LCF

跳至解决方案
1,948 次查看
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??

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,510 次查看
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 项奖励
回复
4 回复数
1,510 次查看
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 项奖励
回复
1,510 次查看
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 项奖励
回复
1,511 次查看
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 项奖励
回复
1,510 次查看
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 项奖励
回复