"undefined reference to" error
Posted: Fri Feb 01, 2019 5:04 am
Hi guys.
When I tried to compile my source, it failed saying
Here is my directory structure.
Here is test_func.h source code.
Here is test_func.c source code.
What is wrong?
Sorry for such a beginner question, but I'm not used to c programming.
When I tried to compile my source, it failed saying
.undefined reference to `test_func'
Here is my directory structure.
Here is main.c source code.- esp-idf
- my_lib
---- test_func.h
---- test_func.c
- my_project
---- main
-------- main.c
Code: Select all
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_log.h"
#include "sdkconfig.h"
#include "../../my_lib/test_func.h"
void app_main()
{
test_func();
}
Code: Select all
void test_func(void);
Code: Select all
#include "esp_log.h"
#include "test_func.h"
void test_func() {
ESP_LOGI("TEST", "TEST");
}
Sorry for such a beginner question, but I'm not used to c programming.