I create a "reference.c" in the same folder with main.c, inside reference.c I define reference function:
Code: Select all
#include"reference.h"
extern "C" {
#include "esp_heap_alloc_caps.h"
}
extern void SmbDaemon()
{
printf( "\n entered checking function");.
printf("\n free 32bit heap is %d",xPortGetFreeHeapSizeCaps(MALLOC_CAP_32BIT));
}
Code: Select all
extern void SmbDaemon()
i got this
Code: Select all
" Undefined reference to `xPortGetFreeHeapSizeCaps(unsigned int) when compiling"
However, If i directly call printf("\n free 32bit heap is %d",xPortGetFreeHeapSizeCaps(MALLOC_CAP_32BIT))in main.c, code can be compiled and work well.
what should i modify?