views:

97

answers:

2

Hello there I am facing a weird problem I have defined I a structure in a C header file:

typedef struct iRecActive{

    char iRecSID[32];
    unsigned char RecStatus;
    int curSel;

}iRecAcitve_t;

but when I use the same structure in another file, the compiler doesn't recognize the structure even though I have double checked that I have included its header file. Following is the error :

: error C2065: 'iRecActive_t' : undeclared identifier

Following is the full code of the file where I have defined the structure

#ifndef _TS_HTTP_APPLICATION_H_
#define _TS_HTTP_APPLICATION_H_

#ifdef __cplusplus
extern "C"
{
#endif

typedef struct iRecActive{

    char iRecSID[32];
    unsigned char RecStatus;
    int curSel;

}iRecAcitve_t;

int startHTTPServer(int HTMLserverPort);
int closeHTTPServer();

int openTS_SegmenterN();
void pushTSDataN(unsigned char* TSData, int len);
void closeTS_SegmenterN();

void removeAllConnections();

#ifdef __cplusplus
}
#endif

#endif
+4  A: 

change iRecAcitve_t to iRecActive_t.

adamk
@adamk it can still work if author uses iRecAcitve_t to create the instance of typedef structure?
Kedar
Thanks a lot man, you literally scanned my code. And I am an absurd :DOnce again thanks
Omayr
@Kedar, yes but if the code already references iRecActive_t, then changing the declaration is easier.
Matt Ellen
@Kedar, and this is where I'll cite the broken window theorem. When you see a single broken window, fix it, else all of your windows will soon be broken.
Nathan Ernst
A: 

I have run into another problem, I am getting an error:

: error C2275: 'iRecActive_t' : illegal use of this type as an expression : see declaration of 'iRecActive_t'

and the declaration is same as mentioned in the problem statement

Omayr
With further problems, edit your question or post another question. Do not post it as an answer :) If you already accepted an answer a new question is probably much better than editing the original.
PeterK