Problems with the linker in CW for MCU v10.5

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

Problems with the linker in CW for MCU v10.5

跳至解决方案
1,013 次查看
riadheos
Contributor I

Hello everyone,

 

I recently started working with CodeWarrior on the TRK-MPC5606B development board.

I used the project included in the DVD and I was able to run it on the board.

I then made a few changes to the code using standard C library built-in functions (nothing complicated, just printf, sprintf and some string manipulation functions).

The project was compiled but the linker failed to finish the build with the following error for each of the function used:

>undefined: 'sprintf'

>Referenced from 'main' in main_c.obj

C:/Freescale/CW MCU v10.5/MCU/PA_Tools/Command_Line_Tools/mwldeppc|Linker|Error

>Link failed.

Of course, the header files: string.h, stdio.h & stdlib.h are already included in the source code.

I also checked the include paths and the directory containing the necessary files is there (see screenshot below).

18050_18050.pngCapture.PNG.png

 

Any help would be appreciated.

 

Best Regards,

Riadh

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
690 次查看
trytohelp
NXP Employee
NXP Employee

Hi Riadh,

I don't have a board so I can not test it.

I've created an example based on MCU V10.6 and on MCU V10.5

In the example, I've added sprintf code and was able to build the project on both version without problem.

Attached you will fidn the example I've created for MCU v10.5


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
691 次查看
trytohelp
NXP Employee
NXP Employee

Hi Riadh,

I don't have a board so I can not test it.

I've created an example based on MCU V10.6 and on MCU V10.5

In the example, I've added sprintf code and was able to build the project on both version without problem.

Attached you will fidn the example I've created for MCU v10.5


Have a great day,
Pascal
Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
690 次查看
riadheos
Contributor I

Hi Pascal,

All the functions are working fine now.

However, I could not identify the difference between the example project and the one you sent me, which is somewhat confusing.

Anyway, thank you for your support.

Best Regards,

Riadh

0 项奖励
回复