I took a sample of freertos_hello from the SDK, build and run on target and it is running fine. I use MCUXpresso IDE.
I want to add a task entry APP_sensorTask() inside main(). The definition of this task entry is in App.h like following:
#ifndef APP_APP_H_
#define APP_APP_H_
#ifdef __cplusplus
extern "C" {
#endif
// App task entries.
void APP_sensorTask(void *argument);
#ifdef __cplusplus
}
#endif
#endif /* APP_APP_H_ */
Then the implementation is in App.cpp like following:
// Project includes.
#include "App.h"
void APP_sensorTask(void *argument) {
for (;;) {
// TODO.
}
}
Then I include App.h inside the main() file.
But this creates linking error:
source/main.c:60: undefined reference to `APP_sensorTask'
This means the project base not recognizing and compiling this .cpp file. I have been using this on another project using another IDE and it works fine. Anything I miss here?