Помощь - Поиск - Пользователи - Календарь
Полная версия этой страницы: UIP Ошибка field 'p' has incomplete type
Форум разработчиков электроники ELECTRONIX.ru > Микроконтроллеры (MCs) > AVR
Alex_new
Доброго времени суток.

Осваиваю Ethernet по стеку uIP. При использовании стандартного примера"Hello world" возникла ошибка "field 'p' has incomplete type".

Код
#ifndef __HELLO_WORLD_H__
#define __HELLO_WORLD_H__

/* Since this file will be included by uip.h, we cannot include uip.h
   here. But we might need to include uipopt.h if we need the u8_t and
   u16_t datatypes. */
#include "uip/uipopt.h"

#include "uip/psock.h"

/* Next, we define the uip_tcp_appstate_t datatype. This is the state
   of our application, and the memory required for this state is
   allocated together with each TCP connection. One application state
   for each TCP connection. */
typedef struct hello_world_state {
    struct psock p; [u]//ошибка тут[/u]
    char inputbuffer[10];
    char name[40];
} uip_tcp_appstate_t;

/* Finally we define the application function to be called by uIP. */
void hello_world_appcall(void);
#ifndef UIP_APPCALL
#define UIP_APPCALL hello_world_appcall
#endif /* UIP_APPCALL */

void hello_world_init(void);

#endif /* __HELLO_WORLD_H__ */


Помогите пожалуйста разораться.
Сергей Борщ
К моменту, когда компилятор встретил эту строку, он еще не стречал определения структуры psock. Поэтому он понятия не имеет, сколько памяти под нее зарезервировать в hello_world_state. Вероятнее всего, вы забыли где-то в начале подключить заголовочный файл с определением этой структуры. Вижу выше #include "uip/psock.h", если это определение находится в этом файле, то надо разбираться, почему компилятор его пропустил (вероятно из-за каких-то #ifdef).
Для просмотра полной версии этой страницы, пожалуйста, пройдите по ссылке.
Invision Power Board © 2001-2024 Invision Power Services, Inc.