Porting Code and File Organization
Posted: Wed Mar 22, 2017 11:36 pm
I am using Eclipse to develop, and currently everything is located in the main directory. When I create a subdirectory and move my .c files to that subdirectory, the compiler gives an "undefined reference to function_name()" error. This means, as I understand, that the .c file in the subdirectory is not being compiled.
Example:
/main/
main.c
/main/test_directory/
test.h
test.c
Inside /main/main.c I cannot call any functions in the test.c file.
I tried updating the Makefile in the main directory.
I also want to port the libssh and protobuf libraries so I can use them in the ESP32. Any help would be greatly appreciated.
Thanks!
Example:
/main/
main.c
/main/test_directory/
test.h
test.c
Inside /main/main.c I cannot call any functions in the test.c file.
I tried updating the Makefile in the main directory.
Code: Select all
TOP_DIR := $(shell pwd)
PROJECT_NAME := app-template
EXTRA_COMPONENT_DIRS := $(TOP_DIR) $(TOP_DIR)/main/tester/
include $(IDF_PATH)/make/project.mk
Thanks!