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 have a problem trying update my old version software developed in c51

I have an old version of c51 where I develop an application. I want to use a newer version of this compiler (c51), I want my old version to compile in the new version of c51. How can I make this work?
Thanks!

Parents
  • "What means that error?"

    It means exactly what it says, but I guess that doesn't help so much when English isn't your native language.

    In 'C', everything must be defined exactly once - no more, no less.

    "Redefinition" just means that something already defined is being defined again - this is not allowed!

    In your particular case, the messages are telling you that '_abs' is already defined, when line 537 of MATH.H attempts to define it again; similarly, line 538 is attmepting to define '_labs' when it is already defined.

    This could mean that you are including MATH.H twice, or possibly two different versions of MATH.H - both of which attempt to define these symbols.

    You will need to search through your source files & headers to check this.

Reply
  • "What means that error?"

    It means exactly what it says, but I guess that doesn't help so much when English isn't your native language.

    In 'C', everything must be defined exactly once - no more, no less.

    "Redefinition" just means that something already defined is being defined again - this is not allowed!

    In your particular case, the messages are telling you that '_abs' is already defined, when line 537 of MATH.H attempts to define it again; similarly, line 538 is attmepting to define '_labs' when it is already defined.

    This could mean that you are including MATH.H twice, or possibly two different versions of MATH.H - both of which attempt to define these symbols.

    You will need to search through your source files & headers to check this.

Children
  • Thanks a lot, I checked de code and in fact it has twice the same declaration.

    I remember that a had another problem, this software is going to work in a EPROM 8051. I need to create the ".HEX" file. But the .BAT file I use to do that isn't work, I read that some commands has changed and I modify this, but is still not working.

    See the ".BAT"

    L51 avion3.OBJ,lft.OBJ,clk.obj,ram.OBJ TO avion3 CO(?C_C51STARTUP(2000h),2000h) XD(?XD?lft(0),?XD?clk(7FF8h),?XD?ram(8000h))
    OH51 avion3

    Where "Avion" is the name of the program in C

    The errors are:

    I used de command OHS51 and with that command the compiler say that isn't a valid command, so I changed for OH51

    This is the error that show

    OBJECT TO HEX FILE CONVERTER OH51 V2.6
    COPYRIGHT KEIL ELEKTRONIK GmbH 1991 - 2001

    *** ERROR: CAN'T OPEN FILE 'avion3'

    and with the command L51 say that isn't a valid command, so I changed for BL51 and now the program enter in a never end loop

    I don't know how to rewrite the ".bat", any idea?

  • "*** ERROR: CAN'T OPEN FILE 'avion3'"

    This probably means that the file either doesn't exist at all, or is not in the location specified or assumed.

    Given that you are also having problems with your Linker command line, probably the file doesn't exist at all because you haven't managed to get the Linker to create it yet!

    "I used de command OHS51 and with that command the compiler say that isn't a valid command"

    It wouldn't be the Compiler that said that - it would be your operating system.

    "so I changed for BL51"

    Yes, that is the correct name for the current Linker.

    "the program enter in a never end loop"

    You need to check that the complete command line is valid for BL51.
    Here is the Manual:
    http://www.keil.com/support/man/docs/bl51/

    "I don't know how to rewrite the ".bat", any idea?"

    BAT files are pretty simple things - basically just a sequence of commnd lines.
    See a standard PC reference book.