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

alexyuan
Posts: 1
Joined: Thu Sep 17, 2020 7:34 am

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

Postby alexyuan » Thu Sep 17, 2020 7:42 am

编译官方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"

ESP_morris
Posts: 116
Joined: Wed Sep 05, 2018 6:23 am

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

Postby ESP_morris » Mon Sep 21, 2020 3:16 am

esp_event_handler_instance_t位于esp_event_base.h中,是8个月前加入的,有没有可能你copy的example是从最新的idf上拿的,而编译用的IDF版本比较老?

Who is online

Users browsing this forum: No registered users and 3 guests