Undefined reference to `xPortGetFreeHeapSizeCaps(unsigned int)
Posted: Wed Nov 15, 2017 9:38 am
I tried using xPortGetFreeHeapSizeCap to check the free heap of esp.
I create a "reference.c" in the same folder with main.c, inside reference.c I define reference function:
in "reference.h" i declare:
. and in main.c i call SmbDaemon()
i got this
if i remove "printf("\n free 32bit heap is %d",xPortGetFreeHeapSizeCaps(MALLOC_CAP_32BIT));" i can compile and enter SmbDaemon()
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?
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?