including <stdio.h> causes compile errors, CW10.4, MQX 4.0.1

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

including <stdio.h> causes compile errors, CW10.4, MQX 4.0.1

Jump to solution
1,380 Views
Cdn_aye
Senior Contributor I

Hi

we are using CW10.4, MQX 4.0.1

In user_config.h, I did:

#define MQX_SUPPRESS_STDIO_MACROS                       0

rebuilt all the mqx libraries, then my app

as per past suggestions but I get 58 fatal errors, conflicts with the file system, and EWL libraries...when I build my app with <stdio.h> included and no calls to any of the functions. I need to use snprintf, so I have to include stdio.h

Any advice would be appreciated. Thanks

Robert

Labels (1)
Tags (4)
1 Solution
759 Views
Cdn_aye
Senior Contributor I

Hi Martin

Now I understand; I just remove the stdio include and rebuild mqx with MQX_SUPPRESS_STDIO_MACROS removed and use as normal. I will do this and report back to complete the post. Thank you.

Regards

Robert

I removed the <stdio.h> and it compiles without error. Thank you.

View solution in original post

0 Kudos
5 Replies
759 Views
Martin_
NXP Employee
NXP Employee
759 Views
BielikM
Contributor III

Function snprintf  is also part of MQX FIO driver. Feel free to use it without any changes.

759 Views
Cdn_aye
Senior Contributor I

"Function snprintf  is also part of MQX FIO driver. Feel free to use it without any changes."


I tested includeing <stdio.h>on our IAR toolset and it compiles, links and runs without problems. But I cannot get it to do the same in Codewarrior 10.4. Is there some setting I would need to link against? I do not want to make a multitude of changes and have to try to keep them up to date as MQX changes. That won't work for me.

I don't know how to use snprintf from FIO. Can you give me an example please?

Thank you

Robert

0 Kudos
759 Views
BielikM
Contributor III

Hi,

MQX FIO driver is part of MQX in default. Without any changes you can use functions from FIO in all examples.

You don't need to use stdio library. If you have to use stdio.h(provided by compiler, not MQX), then use MQX_SUPPRESS_STDIO_MACROS  macro.

Regards,

Martin

760 Views
Cdn_aye
Senior Contributor I

Hi Martin

Now I understand; I just remove the stdio include and rebuild mqx with MQX_SUPPRESS_STDIO_MACROS removed and use as normal. I will do this and report back to complete the post. Thank you.

Regards

Robert

I removed the <stdio.h> and it compiles without error. Thank you.

0 Kudos