• AVR Freaks

Hot!Changing to XC8 V 2.00 from 1.44 fails a working program

Author
francis_jeffries
Junior Member
  • Total Posts : 103
  • Reward points : 0
  • Joined: 2015/11/24 09:35:02
  • Location: 0
  • Status: offline
2019/10/25 07:06:10 (permalink)
0

Changing to XC8 V 2.00 from 1.44 fails a working program

I have switched to using XC8 2.00 from 1.44 with the dongle for PRO in a small project from MPLABX V5.10. It uses a 16F1824. I changed from 1.44 to 2.00 in an attempt to stop all those 32-bit warnings in my Mac before switching to OS Catalina.
 
The project no longer compiles, and the problem arises immediately:
"/Applications/microchip/xc8/v2.00/bin/xc8-cc" -mcpu=16F1824 -c ...blah, blah,.../main.p1 main.c
globals.h:1:1: warning: (374) missing basic type; int assumed
globals.h:1:1: error: (314) ";" expected
 
This is the offending line 1 from globals.c:
extern signed char pointer;
 
main.c begins:
#include <htc.h>
#include "defines.h"
#include "globals.h"
#include "protos.h"
 
Is this an issue with XC8 v2.00? Is there a handbook to go with it?
 
 
#1

17 Replies Related Threads

    JPortici
    Super Member
    • Total Posts : 1114
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:14:08 (permalink)
    +1 (1)
    what about the last line of defines.h?
    do your header files have guards? (ifndef and endif to prevent them to be loaded more than once
    post edited by JPortici - 2019/10/25 07:15:50
    #2
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:25:47 (permalink)
    0
    That could be it, although it's never been a problem before.
    But what are they and where should they be?
    #3
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:32:30 (permalink)
    0
    The last line of defines did indeed lack a CR!
    But adding it hasn't fixed the problem, I'm afraid.
    #4
    du00000001
    Just Some Member
    • Total Posts : 3850
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:36:25 (permalink)
    +1 (1)
    The blah-blah is the interesting part of the story: did you set XC8 2.0 to C90 mode ?
     
    Oh - and yes: XC8 2.0's documentation is where it is supposed to be.

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #5
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:40:59 (permalink)
    0
    the last line of defines did lack a CR - now fixed. 
    So I tried this in globals.h:
    #ifndef globals.h
    #define globals.h
    extern signed char pointer;
    extern unsigned char FIFO[];
    extern unsigned char temp;
    #endif
     
    Still no joy:
    globals.h:1:16: warning: (163) unexpected text in control line ignored
    globals.h:1:16: warning: (163) unexpected text in control line ignored
    globals.h:4:1: warning: (374) missing basic type; int assumed
    globals.h:4:1: error: (314) ";" expected
    globals.h:4:1: warning: (374) missing basic type; int assumed
    globals.h:4:1: error: (314) ";" expected
    main.c:43:6: error: (192) undefined identifier "pointer"
     
    #6
    JPortici
    Super Member
    • Total Posts : 1114
    • Reward points : 0
    • Joined: 2012/11/17 06:27:45
    • Location: Grappaland
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:41:34 (permalink)
    +2 (2)
    About header guards https://en.wikipedia.org/wiki/Include_guard
    (they will be generated automatically by mplab x when you add a new header file to the project)
     
    you may want to try a clean-build, too.
    Also, setting the compiler in C90 mode (project's compiler settings) will make it run more or less as if it still was 1.45
    Also, we are now at version 2.10! I suggest you use it because in 2.00 the libraries (standard c library and possibly internal functions, such as software multiply,divide,floating point) used considerably more memory for some reason (probably because they had to make sure they were C99 compliant, and optimized them more in subsequent releases)
     
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6722
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:48:26 (permalink)
    +2 (2)
    francis_jeffries
    the last line of defines did lack a CR - now fixed. 
    So I tried this in globals.h:
    #ifndef globals.h
    #define globals.h
    extern signed char pointer;
    extern unsigned char FIFO[];
    extern unsigned char temp;
    #endif
     
    Still no joy:
    globals.h:1:16: warning: (163) unexpected text in control line ignored
    globals.h:1:16: warning: (163) unexpected text in control line ignored
    globals.h:4:1: warning: (374) missing basic type; int assumed
    globals.h:4:1: error: (314) ";" expected
    globals.h:4:1: warning: (374) missing basic type; int assumed
    globals.h:4:1: error: (314) ";" expected
    main.c:43:6: error: (192) undefined identifier "pointer"
     


    the compiler tried to help you
    it bailed at the 16th character in line 1 ( the '.' )
    change "globals.h" to "globals_h" within the "globals.h" file
    #8
    du00000001
    Just Some Member
    • Total Posts : 3850
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 07:50:02 (permalink)
    +1 (1)
    Another thought: check that your source files are plain ASCII - not fancy UTF-8.
    (I've had a colleague that inadvertently changed the encoding of some file(s). This makes no difference at all - except for the compiler.)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #9
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 08:00:58 (permalink)
    0
    Ah ha! So I tried this:
    #ifndef globals_h
    #define globals_h
    extern signed char pointer;
    extern unsigned char FIFO[];
    extern unsigned char temp;
    #endif
     
    ...and get this new warning:
    globals.h:4:1: warning: (374) missing basic type; int assumed
    globals.h:4:1: error: (314) ";" expected
    main.c:43:6: error: (192) undefined identifier "pointer"
     
    So do I need something after #define globals_h? #define globals_h; for example?
    #10
    Jim Nickerson
    User 452
    • Total Posts : 6722
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 08:40:25 (permalink)
    +2 (2)
    use "xc.h" rather then "htc.h"
     

    Attached Image(s)

    #11
    ric
    Super Member
    • Total Posts : 28006
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 13:57:43 (permalink)
    +1 (1)
    JANickerson
    use "xc.h" rather then "htc.h"

    +1
    I have seen two queries about if C90 mode is being used, but francis_jeffries has never answered.
    (Although I would expect many more errors if it was in C99 mode)
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #12
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11935
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/25 14:09:05 (permalink)
    +1 (1)
    htc.h just includes xc.h and nothing else.  While htc.h is "incorrect", changing it to xc.h is not going to fix anything.
    #13
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/26 02:56:35 (permalink)
    0
    I thought I had answered! And I had copied the whole line with C90 in it to the response. Something's playing up!
    Maybe I'd better shut my machine down and reboot everything tp be sure.
    #14
    ric
    Super Member
    • Total Posts : 28006
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/10/26 04:13:01 (permalink)
    +1 (1)
    The command line itself probably triggered the web server firewall, causing your post to get discarded.
    Any text containing E X E gives the firewall conniptions...

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #15
    Ambient Power
    New Member
    • Total Posts : 11
    • Reward points : 0
    • Joined: 2015/10/01 08:58:19
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2019/12/04 04:37:46 (permalink)
    -2 (2)
    XC8, even V2.10, is not functioning under Catalina. We are awaiting updates from Microchip. For now, you have to use a PC.
    #16
    francis_jeffries
    Junior Member
    • Total Posts : 103
    • Reward points : 0
    • Joined: 2015/11/24 09:35:02
    • Location: 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2020/06/18 05:52:47 (permalink)
    -1 (1)
    So, 6 months later, has Microchip brought in a fix for Catalina? 
     
    And will they supply a 64-bit replacement dongle for my existing XC8 dongle?
    #17
    RISC
    Super Member
    • Total Posts : 5776
    • Reward points : 0
    • Status: offline
    Re: Changing to XC8 V 2.00 from 1.44 fails a working program 2020/06/18 06:21:38 (permalink)
    0 (2)
    Hi,
    So you mean your XC8 dongle works with 32bits versions of XC8 compiler and not with the latest 64bits version ?
    If so, you should put a ticket to Microchip support : http://www.microchip.com/support
    Regards
     
    #18
    Jump to:
    © 2020 APG vNext Commercial Version 4.5