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

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

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

ソリューションへジャンプ
2,255件の閲覧回数
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

ラベル(1)
タグ(4)
1 解決策
1,634件の閲覧回数
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 件の賞賛
返信
5 返答(返信)
1,634件の閲覧回数
Martin_
NXP Employee
NXP Employee
1,634件の閲覧回数
BielikM
Contributor III

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

1,634件の閲覧回数
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 件の賞賛
返信
1,634件の閲覧回数
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

1,635件の閲覧回数
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 件の賞賛
返信