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

C231 Redefinition with xdata

Hello,

I'm using the C51 compiler for a C8051F043 target. I'm allocating a variable array with the statement:

unsigned char xdata gbuf[2048];

When I compile, I get an Error C231, redefinition of gbuf. The problem is, it's not defined elsewhere in code. To make sure I commented out this statement, and sure enough, I get a linker error because it can't find gbuf. Has someone got an idea of what my problem may be?

Thanks, Brian Warren

Parents
  • "The existence of that header files shouldn't have caused any problems."

    Oh yes it should!

    "If it did, that means not only was there a declaration of this variable in your header, but that it was conflicting with the definition you cited."

    Exactly: and the message you get will complain about a re-definition - which was precisely the issue reported in the original post.

Reply
  • "The existence of that header files shouldn't have caused any problems."

    Oh yes it should!

    "If it did, that means not only was there a declaration of this variable in your header, but that it was conflicting with the definition you cited."

    Exactly: and the message you get will complain about a re-definition - which was precisely the issue reported in the original post.

Children