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
Solved! Go to Solution.
in your .c file you should include at least mqx.h and bsp.h:
#include <mqx.h>
#include <bsp.h>
in your .c file you should include at least mqx.h and bsp.h:
#include <mqx.h>
#include <bsp.h>
Martin, thanks for your reply.
it's already include those header file in my .c file.
Mini
_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.
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.