首页 > 解决方案 > 如何在 Espressif IDF Eclipse 项目的不同源文件中包含 FreeRTOS 头文件

问题描述

在 Eclipse 中创建 ESPRESSIF 项目后,我看到以下包含已存在于main.

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_syst"
#include "esp_wifi.h"
#include "esp_event.h"
#include "esp_log.h"
#include "nvs_flash.h"
#include "lwip/sockets.h" 

我猜包含的文件是由IDF_PATH. 但是您如何在任何其他源文件中使用这些文件呢?相同的包含将不起作用。

// file1.c
#include "lwip/sockets.h" // Unresolved inclusion: "lwip/sockets.h"

下面是属性的快照。由于某种原因,我没有看到一个C/C++ build部分,否则我知道有一个选项可以将文件路径放在那里,然后任何源文件都可以使用它而无需指定相对路径。 在此处输入图像描述

供参考:我遵循本教程-> https://github.com/espressif/idf-eclipse-plugin/blob/master/README.md#create-a-new-project直到Compiling the Project

标签: ceclipseesp32freertos

解决方案


推荐阅读