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

Need help with Keil C51

I am a long-time assembler guy in 8051's and PICs, and just got my new Keil C51 IDE package. I am, not fluent in 'C' or Keil tools (yet). I have to look at someone else's existing code and compile it, but I get errors after loading their project and trying a build. Since I am new to the tool set, I am stumped on figuring out what is wrong. Is anyone out there who would take this set of files and help me figure out how ot get it to compile, or what is missing, for a fee? I could send the files and maybe you could help me understand what is wrong or missing? If I was more fluent with the tool set, I could get there myself, but time is critical. Can anyone help? (If this is posed in the wrong place, please forgive me!)
Chris

Parents
  • I don't know if this will help, but here it is:

    Build target 'Target 1'
    compiling main_standalone.c...
    main_standalone.c(25): warning C206: 'PORT_init': missing function-prototype
    main_standalone.c(52): warning C206: 'Init_ADC': missing function-prototype
    main_standalone.c(60): warning C206: 'Init_SpiMaster': missing function-prototype
    main_standalone.c(63): warning C206: 'Read_Calibration_Values': missing function-prototype
    main_standalone.c(97): warning C206: 'CheckThresholds': missing function-prototype
    main_standalone.c(100): warning C206: 'CheckCurrent': missing function-prototype
    main_standalone.c(107): error C231: 'CheckThresholds': redefinition
    main_standalone.c(164): error C231: 'CheckThresholds': redefinition
    main_standalone.c(166): error C231: 'CheckCurrent': redefinition

Reply
  • I don't know if this will help, but here it is:

    Build target 'Target 1'
    compiling main_standalone.c...
    main_standalone.c(25): warning C206: 'PORT_init': missing function-prototype
    main_standalone.c(52): warning C206: 'Init_ADC': missing function-prototype
    main_standalone.c(60): warning C206: 'Init_SpiMaster': missing function-prototype
    main_standalone.c(63): warning C206: 'Read_Calibration_Values': missing function-prototype
    main_standalone.c(97): warning C206: 'CheckThresholds': missing function-prototype
    main_standalone.c(100): warning C206: 'CheckCurrent': missing function-prototype
    main_standalone.c(107): error C231: 'CheckThresholds': redefinition
    main_standalone.c(164): error C231: 'CheckThresholds': redefinition
    main_standalone.c(166): error C231: 'CheckCurrent': redefinition

Children
  • main_standalone.c(25): warning C206: 'PORT_init': missing function-prototype

    That one's bad enough, but not fatal. It's telling you that the function given in the message has not been explained to the compiler properly, before it was used.

    Now this, OTOH:

    main_standalone.c(107): error C231: 'CheckThresholds': redefinition

    is an entirely different matter. This means that for whatever reason there are two implementations of the same function being presented to the compiler. That's an inexcusable blunder.

    This means that your task has been incorrectly stated. This cannot be bug-hunting in an existing program, because there clearly is no existing program.

  • "is an entirely different matter. This means that for whatever reason there are two implementations of the same function being presented to the compiler."

    Probably not two implementations.

    Just a call where the compiler warned about missing prototype, but compiler made an assumption.

    Some lines later, it finally got to the implementation and found the assumption wrong. Then time for the error.

  • Some lines later, it finally got to the implementation and found the assumption wrong. Then time for the error.

    But how would that explanation account for getting two "redefinition" errors for the same function?

  • Just that line 164 doesn't look like an implementation - next error at 166. Unless we are talking one-liners.