This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil error

Hi to every body

I use uVision3 for compile a program.My program have some of .h and .c files. In one of them that called "guts.h", I define :

typedef struct yaffs_DeviceStruct yaffs_Device;

typedef struct {
        __u8 tagByte0;
        __u8 tagByte1;
        __u8 tagByte2;
        __u8 tagByte3;
        __u8 pageStatus;
        __u8 blockStatus;
        __u8 tagByte4;
        __u8 tagByte5;
        __u8 ecc1[3];
        __u8 tagByte6;
        __u8 tagByte7;
        __u8 ecc2[3];
} yaffs_Spare;

and in other file that called "mtdif.h", I define like this:

#ifndef __YAFFS_MTDIF_H__
#define __YAFFS_MTDIF_H__

#include "yaffs_guts.h"

int nandmtd_WriteChunkToNAND(yaffs_Device * dev, int chunkInNAND,const __u8 * dat, const yaffs_Spare * spare);
#endif

But it has error.
The error is : "undefined yaffs_Device"

But when transfered this code to mtdif.h the error removed:

typedef struct yaffs_DeviceStruct yaffs_Device;

typedef struct {
        __u8 tagByte0;
        __u8 tagByte1;
        __u8 tagByte2;
        __u8 tagByte3;
        __u8 pageStatus;
        __u8 blockStatus;
        __u8 tagByte4;
        __u8 tagByte5;
        __u8 ecc1[3];
        __u8 tagByte6;
        __u8 tagByte7;
        __u8 ecc2[3];
} yaffs_Spare;

what is the problem? The problem when increase that I include guts.h in some of my files. In all of files that use variables that defined in "guts.h" has error.
what is problem? what I do for solve it?

Thanks very much

Parents
  • Definition of yaffs_DeviceStruct in guts.h :

    struct yaffs_DeviceStruct { struct list_head devList; const char *name; int nDataBytesPerChunk; int nChunksPerBlock; int nBytesPerSpare; int startBlock; int endBlock; int nReservedBlocks; int checkpointStartBlock; int checkpointEndBlock;
    };

    The error is :

    MTDIF.H(22): error C141: syntax error near '*', expected ')'

Reply
  • Definition of yaffs_DeviceStruct in guts.h :

    struct yaffs_DeviceStruct { struct list_head devList; const char *name; int nDataBytesPerChunk; int nChunksPerBlock; int nBytesPerSpare; int startBlock; int endBlock; int nReservedBlocks; int checkpointStartBlock; int checkpointEndBlock;
    };

    The error is :

    MTDIF.H(22): error C141: syntax error near '*', expected ')'

Children