Page 1 of 1

编译时报错,unknown type name 'esp_event_handler_instance_t'; did you mean 'esp_event_handler_t'

Posted: Thu Sep 17, 2020 7:42 am
by alexyuan
编译官方gatt server 例子,将 wifi get started 例子挪过部分code,
报错 unknown type name 'esp_event_handler_instance_t'; did you mean 'esp_event_handler_t',
引入如下:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "esp_system.h"
#include "esp_event.h"
#include "esp_wifi.h"
#include "esp_log.h"
#include "esp_bt.h"
#include "esp_gap_ble_api.h"
#include "esp_gatts_api.h"
#include "esp_bt_defs.h"
#include "esp_bt_main.h"
#include "esp_gatt_common_api.h"

#include "sdkconfig.h"
#include "nvs_flash.h"

Re: 编译时报错,unknown type name 'esp_event_handler_instance_t'; did you mean 'esp_event_handler_t'

Posted: Mon Sep 21, 2020 3:16 am
by ESP_morris
esp_event_handler_instance_t位于esp_event_base.h中,是8个月前加入的,有没有可能你copy的example是从最新的idf上拿的,而编译用的IDF版本比较老?