add file to MQX project issue

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

add file to MQX project issue

ソリューションへジャンプ
1,664件の閲覧回数
miniwang
Contributor III

Hi,

I created a empty MQX project, there are 2 files created - main.c and main.h.

I wrote a sample function(control GPIO) in main.c, it's OK for compile ,download and debug.

But when I try to move the function to another file(ex: IO.c, IO.h) to organize the code, there are thousand error occured.

(undefined identifier '_mqx_uint'  , identifier expected  , illegal function definition..........etc.)

Is there any setting should I do when I add other file to MQX project?

the environment : CodeWorrior 10.2  &  MQX 3.8.1

Thank you in advance.

Mini


タグ(3)
0 件の賞賛
返信
1 解決策
1,255件の閲覧回数
Martin_
NXP Employee
NXP Employee

in your .c file you should include at least mqx.h and bsp.h:

#include <mqx.h>

#include <bsp.h>

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,256件の閲覧回数
Martin_
NXP Employee
NXP Employee

in your .c file you should include at least mqx.h and bsp.h:

#include <mqx.h>

#include <bsp.h>

0 件の賞賛
返信
1,255件の閲覧回数
miniwang
Contributor III

Martin, thanks for your reply.

it's already include those header file in my .c file.

Mini

0 件の賞賛
返信
1,255件の閲覧回数
Martin_
NXP Employee
NXP Employee

_mqx_unit typedef is in the header file psptypes.h.

psptypes.h is inclucded into your project via bsp.h, which includes psp.h, which includes psptypes.h

It seems the compiler can't find the psp header files in your project.

So you should double check all your compiler include paths - it seems the psp header files are not included. Compiler settings are specific to a project.

1,255件の閲覧回数
miniwang
Contributor III

Thanks a lot, Martin.

This issued have be solved.

The solution is add #include "main.h" in IO.c file. mqx.h and bsp.h are included in main.h.

I'm curious that I've already include mqx.h and bsp.h in IO.c, why I still need to include main.h?

Anyway, thanks for your help.