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

I get error redefinition when I use target device DS87C550

I write a program using Keil C for 89C52. This program is successfully compiled. But when I choose another microcontroller (DS87C550), but I still keep the same program ( I just change the hearder file ), it get error like this : P0 redefinition, P1 redefinition, ....
If anyone know how to solve this, please post your thread here or send an email to me : duyduong@vitek.com.vn.
Thanks in advance.

  • It sounds as though you must have a device specific header file included twice somehow. The device specific includes don't seem to have multi inclusion traps so it could be the same header file or two different ones.

    I think you'll just have to look more closely at your #include statements to find the problem.

    I think uvision automatically inserts the appropriate header file under certain circumsdances - this could be what is causing the problem when you change device.

    Stefan

  • Maybe you have written these lines at the begginig of your program

    something look like this:

    #include "regs.h"
    #include "regs2.h"

    names of header files are only for example.

    You must define symbols only at once. So chceck using of header files.

    Radim

  • Hi, Stefan Duncanson and Radim Vondra !
    Thanks a lot !
    I have checked my program and I found out that I included the header file "reg550.h" in another header file and I used both of them in my program. So this caused the error. I have successfully recomplied it.