How to link extern variable defines in a header file to the main source file?
Posted: Fri May 20, 2022 7:51 pm
I'm trying to access a variables defines in a file I created named button_funcs.h in the same directory as the main.c file and there I defined a freeRTOS QHandle such as extern xQueueHandle DoItQ;
,when I come to compile it with CMake it gives me the following error:
What am I doing wrong? isn't that how you suppose to use extern variables? how'd one make it work?
,when I come to compile it with CMake it gives me the following error:
I have defined the INCLUDE_DIRS "." in IDF component register in CMakeLists.txt and added button_funcs.c to SRCS if that matters.c:/coding/esp32/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.displayRoutine+0x4c): undefined reference to `TimerTickQ'
What am I doing wrong? isn't that how you suppose to use extern variables? how'd one make it work?