Hot!Help with Error on ECAN.h - 18f2580

Author
aqua_life
New Member
  • Total Posts : 23
  • Reward points : 0
  • Joined: 2010/06/09 02:31:09
  • Location: 0
  • Status: offline
2018/09/30 07:24:58 (permalink)
0

Help with Error on ECAN.h - 18f2580

Hello,
Some years ago I made a small project using 18F2580 on ECAN to send and receive CAN messages.
Just a simple program, and it worked well.
Now I need to use CAN again and I was implementing this system again.
However when compiling I have 2 errors. I searched on the internet and it seems this errors are present because now I use MPLAB X. Some years ago with another version of MPLAB there was no errors.
Can anyone help solving this ?
ECAN.h:1643: error: (984) type redeclared
ECAN.h:1643: error: (1098) conflicting declarations for variable "RXB1CONbits" (ECAN.h:1643)
 
Attached I send you ECAN.h file.
 
Thanks for your help
#1

4 Replies Related Threads

    mbrowning
    Just a Member
    • Total Posts : 1279
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: online
    Re: Help with Error on ECAN.h - 18f2580 2018/09/30 10:35:22 (permalink)
    +1 (1)
    Nothing to do with the IDE and everything to do with the compiler. Did you read the comments above line 1643 ?

    Oh well - there's always next year
    #2
    aqua_life
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2010/06/09 02:31:09
    • Location: 0
    • Status: offline
    Re: Help with Error on ECAN.h - 18f2580 2018/09/30 11:43:56 (permalink)
    0
    Thank you !!!!
    I changed from #if 1  to  #if 0   and now don´t have those errors.
    No problem to make this modification ?
    Now when I try to compile I get 2 more errors. I am sorry but I am not able to figure out why I have these errors now. And can´t find much information on google.
    Now I have:
    ECAN.h:1704: error: (985) qualifiers redeclared
    ECAN.h:1704: error: (1098) conflicting declarations for variable "RXBODBEN" (ECAN.h:1704)
     
    Thank you
    #3
    aqua_life
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2010/06/09 02:31:09
    • Location: 0
    • Status: offline
    Re: Help with Error on ECAN.h - 18f2580 2018/09/30 11:55:24 (permalink)
    0
    At line 1335 it says:  Following compile-time logic switches symbols as per compiler
    * being used. Currently, it supports Microchip C18 and HiTech
    * PICC18 compilers only.
     
    At line 1365:    #define RXB0CON_RXB0DBEN        RXB0CONbits.RXBODBEN
     
    At line 1703:    #define RXB0CON_RXB0DBEN RXBODBEN
    At line 1704:    static volatile near bit RXBODBEN @ ((unsigned)&RXB0CON*8)+2;
     
     
    I am using compiler XC8.  Should I use C18 compiler ?
    #4
    aqua_life
    New Member
    • Total Posts : 23
    • Reward points : 0
    • Joined: 2010/06/09 02:31:09
    • Location: 0
    • Status: offline
    Re: Help with Error on ECAN.h - 18f2580 2018/09/30 12:18:26 (permalink)
    0
    Ok, I tried now using C18 compiler and don´t have the errors.
    Thanks
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5