Problems with the linker in CW for MCU v10.5

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

Problems with the linker in CW for MCU v10.5

Jump to solution
777 Views
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

Labels (1)
Tags (1)
0 Kudos
1 Solution
454 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
455 Views
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 Kudos
454 Views
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 Kudos