cancel
Showing results for 
Search instead for 
Did you mean: 

MX_RTC_Init undefined

iDeew
Associate II

Hi,

I'm getting this below compile time errors...

 

 

undefined reference to `MX_RTC_Init'

 

 

However, I have included the rtc.h header file, which contains the declaration of the MX_RTC_Init(void) function.

 

 

#include "main.h"
#include "cmsis_os.h"
#include "fdcan.h"
#include "i2c.h"
#include "lwip.h"
#include "rtc.h"
#include "spi.h"
#include "usart.h"
#include "usb_device.h"
#include "app_touchgfx.h"

 

 

Why does CubeIDE still giving me this error?

Thanks

 

11 REPLIES 11

The file rtc.h is located in the Core/Inc folder, and rtc.c is situated in the Core/Src folder. However, the header file is not appearing in the Project Explorer of CubeIDE. Regrettably, I am unable to share the entire project. Thank you for your understanding.

 


@iDeew wrote:

the header file is not appearing in the Project Explorer of CubeIDE. 


Header files don't need to be listed in the Project - they are found via the #include directives in the code.

More importantly, the rtc.c file is not appearing in your Project - it should be in that list you've marked with the question mark:

AndrewNeil_0-1723218110773.png

That'll be why it's not being built and, thus, why there's no definition for MX_RTC_Init