Problems with the linker in CW for MCU v10.5

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problems with the linker in CW for MCU v10.5

ソリューションへジャンプ
812件の閲覧回数
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 解決策
489件の閲覧回数
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 返答(返信)
490件の閲覧回数
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 件の賞賛
489件の閲覧回数
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 件の賞賛