更新mingw后编译c代码时出错

时间:2011-01-24 09:46:30

标签: c compilation mingw

今天大家好,我在win64环境中更新了mingw 但是现在我在编译错误之前编译没有通知我..

这是错误:

a.h:9:39: error: expected ')' before '*' token
a.h:10:40: error: expected ')' before '*' token
a.h:11:34: error: expected ')' before '*' token

在这个extern a.h文件中:

...
9:  extern void inserisciInPila(puntatore *testa, int x, int y);
10: extern void eliminaDallaPila(puntatore *testa);
11: extern void svuotaPila(puntatore *testa);
12: extern int **allocaLabirinto(int m, int n);
...

这里是另一个定义“puntatore”类型

的.h文件中的代码片段
...
10: typedef struct pila{
11:     int x;
12:     int y;
13:     struct pila *prossimo;
14: } posizionePila;
15: typedef posizionePila *puntatore;
...

例如,我向您展示了第一个函数(inserisciInPila())

...
void inserisciInPila(puntatore *testa, int x, int y){
    puntatore temp;
    temp = malloc(sizeof(posizionePila));
    if(temp==NULL)
        return(NULL);

    temp->x = x;
    temp->y = y;
    temp->prossimo = *testa;
    *testa = temp;
}
...
你可以帮帮我吗?谢谢!

1 个答案:

答案 0 :(得分:2)

在尝试将其用作函数参数类型之前,您需要确保编译器可以看到类型puntatore的声明。

相关问题