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 Reply Children
  • 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 ')'

  • Please re-post that, using the 'pre' and '/pre' tags - as you did in your original post.

    Use the 'Preview' button to check that it's worked proerly before you post.

    "The error is :

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

    That's not what you said originally, is it?

    What line, exactly, does it refer to?

  • 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;
    };
    

  • you not give all code!!!

    list_head not definededed!

    i make project you see and works??

    BUT i put in struct for jist_head

    code is good