좋아, 세 개의 구조체가 있습니다.
struct rss_s {
Radio_types device_type; // Its device_type which is defined by the typedef above Radio_Types
char * device_info; // some thing about the radio NAV/COM/etc.
char * device_model; // the Manufactures part/model number.
char * device_serial; // the device's serial number..
int power_48v; // power to the unit..
int power_400hz;
int panel_lamps; // turn off or on the Panel Lamps only
void * radio_info;
struct radio_s_C614L8
{
loopsw_614L8 loop_sw_614L8; this is an emum
modesw_614L8 mode_sw_614L8; this is an emum
int sw_band;
int sw_bfo;
int meter;
tuner *Tuner;
int tuners;
};
typedef struct tuner_s
{
char *device_name; // OS NAME
int frequency[tuned];
int power;
int dial_lamp;
void * back_radio; // back-link to radios[n]
void * back_info; // back-link to radio_xxxx
int fd[];
} tuner;
나는 그들을 main.c에서 초기화한다.
// Radio 614L8
static tuner tuner_C614L8[] = {{ .device_name = "/dev/TBD", }};
static struct radio_s_C614L8 radio_C614L8 = { .Tuner = &tuner_C614L8, .tuners = DIM(tuner_C614L8) };
static struct rss_s radios[] = {
{ .device_type = C614L8,
.device_info = "ADF",
.device_model = "614L8",
.device_serial = "8384",
.radio_info = &radio_C614L8,},};
위의 내용은 오류없이 작동합니다 ....하지만 위의 라디오를 초기화하려고 할 때 ... init_C614L8.c에서 다음 코드로 오류가 발생합니다 ... 오류 : 4 행의 불완전한 유형 에 대한 포인터 역 참조 & 6
int init_C614L8( struct rss_s * radios ){
int rw, i;
struct radio_s_614L8 * rad_info = radios -> radio_info;
tuner * this_tuner = rad_info -> Tuner;
// Now we will loop over the sub_devices....
for ( i = 0; i < rad_info -> tuners; i++ ) {
캐스트해야 할 것 같은데 쉬지는 않네요 감사합니다
에서 rss.h
당신이 선언
struct radio_s_C614L8
하지만 init_C614L8.c
당신은
struct radio_s_614L8
아무데도 선언되지 않았습니다.
최신 정보:
이 오류를 수정하려면
오류 : 불완전한 유형에 대한 포인터 역 참조
에서 init_C614L8.c
(그리고 다른 장소,하지만 rss.h
) 대체
struct radio_s_614L8
으로
struct radio_s_C614L8
여기서 배운 교훈은 안경을 쓰거나 잠을자는 것입니다! ;-) 그리고 또한 : "컴파일러는 절대 거짓말을하지 않습니다!"
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다