Error C2450 - MC9S12C64

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Error C2450 - MC9S12C64

4,153 次查看
Mickalechenko
Contributor I
Hello, I need help to solve a error C2450 that gives me this code.
The complete message of the error is:  Error : C2450: Expected: ; = ,
                                                                TratamentoDePassagens.c  line 19 

Thank you in advance for the help...

The microcontroller that use is: MC9S12C64
The code is:
#include "TratamentoDePassagens.h"
#include "TDS_TratamentoVolta.h"  
#include "DefinicoesGLobais.h"
#include "Persistencia.h"           
#include "TDS_Auxiliar.h"
#define TAMANHO_DO_DADO_2 4
         
unsigned char proximidadeEntrePassagens = PASSAGENS_PROXIMAS;
unsigned char regioesDePassagem[TAMANHO_DO_DADO_2] = {REGIAO_DISTANTE, REGIAO_DISTANTE, REGIAO_DISTANTE, REGIAO_DISTANTE};
unsigned char vetAbaixoDoLimiarDeDistorcao[] = {0, 0, 0, 0};
unsigned int vetInstantesDeEntrada[] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned int vetInstantesDeSaida[]= {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char picos[TAMANHO_DO_DADO_2] = {0, 0, 0, 0};

extern  T_PASSAGEM  *pPassagemTerminada; // ******** HERE THE ERROR APPEARS !!!!! *******
     
extern unsigned char limiarDeRegiaoProxima[];
extern unsigned char limiarDeRegiaoMuitoProxima[];
extern unsigned char vetIndiceNiveisZeroDeLimiares[TAMANHO_DO_DADO_2];
            
#ifdef USAR_CALIBRACAO
unsigned char *far pNivelInferiorDeSensores = (unsigned char *far)ENDERECO_NIVEIS_0_DE_SENSORES;
#else
unsigned char nivelZeroDeSensores[];
#endif

#pragma CONST_SEG CONST_MUTAVEIS   
extern const T_FUNCAO_CONTAGEM vetFuncoesDeTratamentoDePassagens[] =
{
   
  //  more code... is not important  (I extract it to save space)                                               
       
};

#pragma CODE_SEG FIRM_MUTAVEL
{
 
    //  more code... is not important  (I extract it to save space)

#pragma CODE_SEG DEFAULT
   
Added p/n to subject.


Message Edited by NLFSJ on 2008-10-22 06:51 AM
标签 (1)
0 项奖励
回复
6 回复数

1,582 次查看
CompilerGuru
NXP Employee
NXP Employee
As tip, I would check the preprocessor output.
Daniel
0 项奖励
回复

1,582 次查看
Mickalechenko
Contributor I
Thank you for the response, I was where you said to me (Project - > preprocess) And the error did not appear, but it appears if I compile.

It will be a error of writing code, or a error in the configuration of the codewarrior?

THANKS AGAIN
0 项奖励
回复

1,582 次查看
CompilerGuru
NXP Employee
NXP Employee
The idea was to look at the location in the preprocessor and see if anything got replaced.
T_PASSAGEM maybe a macro defined to something unexpected.
Given the error message and the source code, T_PASSAGEM must be a known type at the location it the error occurs. Search in the preprocessor file backwards and make sure it is a known typedef (and not just a known struct tag, for example. For those "struct T_PASSAGEM" is needed).

Daniel
0 项奖励
回复

1,582 次查看
Mickalechenko
Contributor I
Good days, thanks for your help. I saw the output of the preprocesador and it gives this

/**** FILE 'C:\PRJTs\CP20\CP20v02\CODIGO\TratamentoDePassagens.c' */


/*       12 */  unsigned char proximidadeEntrePassagens = 0 ;
/*       13 */  unsigned char regioesDePassagem [ 4 ] = { 1 , 1 , 1 , 1 } ;
/*       14 */  unsigned char vetAbaixoDoLimiarDeDistorcao [ ] = { 0 , 0 , 0 , 0 } ;
/*       15 */  unsigned int vetInstantesDeEntrada [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
/*       16 */  unsigned int vetInstantesDeSaida [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ;
/*       17 */  unsigned char picos [ 4 ] = { 0 , 0 , 0 , 0 } ;
/*       19 */  extern T_PASSAGEM * pPassagemTerminada ;
/*       21 */  extern unsigned char limiarDeRegiaoProxima [ ] ;
/*       22 */  extern unsigned char limiarDeRegiaoMuitoProxima [ ] ;
/*       23 */  extern unsigned char vetIndiceNiveisZeroDeLimiares [ 4 ] ;
/*       26 */  unsigned char * __far pNivelInferiorDeSensores = ( unsigned char * __far ) 0x3DBC00 ;
/*       33 */  #pragma CONST_SEG CONST_MUTAVEIS
/*       34 */  extern const T_FUNCAO_CONTAGEM vetFuncoesDeTratamentoDePassagens [ ] =
/*       35 */  {
                  .....  more code

In the project that contains many related files and is another file that contains T_PASSAGEM and also it gives error.
I comment  that I must only correct  the code (I did not do it), my question is: exists some form to declare T_PASSAGEM within these same archives where gives the error?

//This is a part of the other file
static byte statusPar[TAMANHO_DO_DADO_2];
static T_PASSAGEM bufPassagem[TAMANHO_BUF_PASSAGEM];  // HERE
byte bufPassagemIndex;
T_PASSAGEM *pPassagemTerminada;
T_PASSAGEM* pPassagem[TAMANHO_DO_DADO_2];
T_PASSAGEM *pPassagemCorrente = NULL;
T_PASSAGEM *pPassagemAnterior;
static byte infoPassagemAnterior;
static T_PASSAGEM passagemAnterior;

Thank for your response







Message Edited by Mickalechenko on 2008-10-22 01:23 PM
0 项奖励
回复

1,582 次查看
Lundin
Senior Contributor IV
To me it seems as if the compiler can't find the type declaration.

Does every file have access to the h-file where T_PASSAGEM is declared? Does that h-file have header guards? What does the declaration look like?
0 项奖励
回复

1,582 次查看
Mickalechenko
Contributor I

Daniel and Lundin thank you very much for the help.


I find in the another file the definition of the T_PASSAGEM !!!!

typedef struct
{
    byte indiceTemporal;
    byte bufPar[TAMANHO_DO_DADO_2];
    byte sentidos;
    byte _1oEstado;
    byte ultimoEstado;
    word tempoDesdeUltimaPassagem;
    byte bufPicos[TAMANHO_DO_DADO_2];
} T_PASSAGEM;



Message Edited by Mickalechenko on 2008-10-24 11:57 AM
0 项奖励
回复