• AVR Freaks

Hot!Compile problems with XC8 and MPLAB X 5.40

Page: 12 > Showing page 1 of 2
Author
blazooo
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2020/09/19 08:45:01
  • Location: 0
  • Status: offline
2020/09/22 16:04:37 (permalink)
0

Compile problems with XC8 and MPLAB X 5.40

Hi,
I've recently installed MPLAB X 5.40 on Ubuntu virtual machine with XC8 2.30 and everything worked fine. Then I tried to install the same combination on Win10, but it seem i have some problems with MPLAB X detecting correct version of the compiler.
When i try to build a super simple C program, the complier error is that -mcpu should be used instead for definition of target MCU. Build line is: 
"C:\Program Files\Microchip\xc8\v2.30\bin\xc8-cc.exe" --pass1 --chip=12F629 -Q -G --double=24 --float=24 --opt=+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=default --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/newmain.p1 newmain.c 
nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/newmain.p1' failed
When i open the Project->Properties and go to the XC8 global setting for C Standard i have only one option (N/A - C89) and information in Option Description is "For versions up to 2.00, C89 is the only option, and it does NOT emit. For v2.00 and newer, C90 (similar to C89) and C99 (CLANG support) show."
I've tried to check the settings in Tools->Options->Embedded and the complier set is as it should. Tried to remove and rescan for tools, when the new tools are set i'm again having the same problem
Tried to clear the Cache folders.
Tried to clear the Cache folders and reinstalled IDE and XC8 (several times, tried to clear registry as much as possible after removal of the applications), but I'm still having the same problem
Is there any way to set the right settings to have XC8 working well?
/Blagoj
#1

20 Replies Related Threads

    Howard Long
    Super Member
    • Total Posts : 837
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: online
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/09/24 14:21:59 (permalink)
    +2 (2)
    I don't know the details of your project, but here's an MPLAB X 5.40 XC 2.30 project for a 12F629 that I just built and it works fine. I didn't fiddle with any of the project settings after creating the project.
     
    Remove the .txt in tha attached file & unzip it.
     
    This was on Windows though.
     

    Attachment(s)

    Attachments are not available: Download requirements not met
    #2
    blazooo
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/09/19 08:45:01
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/09/25 05:32:07 (permalink)
    0
    Thanks Howard. My application is quite similar to the attached project.
    However, both the attached project and my project gives the same error:
    ""C:\Program Files\Microchip\xc8\v2.30\bin\xc8-cc.exe" --pass1  --chip=12F629 -Q -G    --double=32 --float=32 --opt=+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=default  --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-osccal,-resetbits,-download,-stackcall,+clib   --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s"     -obuild/default/production/main.p1 main.c 
    (2042) no target device specified; use the -mcpu option to specify a target device
    make[2]: *** [build/default/production/main.p1] Error 1"

     
    It seems to me that the MPLAB X is not detecting the right version of the compler and forces option tags for older versions of the compiler.
    Does anyone know how MPLAB X detects the tools versions?
    post edited by blazooo - 2020/09/25 05:35:46
    #3
    moser
    Super Member
    • Total Posts : 590
    • Reward points : 0
    • Joined: 2015/06/16 02:53:47
    • Location: Germany
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/05 01:03:20 (permalink)
    0
    Go to menu "Tools", entry "Options", category symbol "Embedded", tab "Build Tools". You can press the "Scan for Build Tools" button there or manually edit the tools.
     
    If your Project is using the wrong tool, then you need to go to the Project Properties. Go to menu "File", entry "Project Properties", in "Categories" select your configuration "Conf: NAME_OF_YOUR_CONFIGURATION". Check the "Packs", "Hardware Tool" and "Compiler Toolchains".
     
     
    #4
    Murton Pike Systems
    Senior Member
    • Total Posts : 49
    • Reward points : 0
    • Joined: 2020/09/10 02:13:01
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/05 04:56:56 (permalink)
    0
    From the error message you havent defined the processor you want to use.
    Click on "production" then "set project configuration" then "customise"
    Then set processor you want to use.
     
    #5
    ric
    Super Member
    • Total Posts : 28696
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/05 12:17:50 (permalink)
    +3 (3)
    Plainly he has defined the chip as a PIC12F629
    It's a faulty XC8 installation causing MPLABX to pass the wrong format command line, so the compiler does not recognise the commands.
     

    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!
    #6
    blazooo
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/09/19 08:45:01
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/06 06:54:36 (permalink)
    +1 (1)
    Go to menu "Tools", entry "Options", category symbol "Embedded", tab "Build Tools". You can press the "Scan for Build Tools" button there or manually edit the tools.

    Tried, the correct xc8 is identified i tools path, but still when building the command line holds old Compiler naming.
     
    If your Project is using the wrong tool, then you need to go to the Project Properties. Go to menu "File", entry "Project Properties", in "Categories" select your configuration "Conf: NAME_OF_YOUR_CONFIGURATION". Check the "Packs", "Hardware Tool" and "Compiler Toolchains".

    Done that, i got information that "bad language tools chain" is used
     
    From the error message you havent defined the processor you want to use.
    Click on "production" then "set project configuration" then "customise"
    Then set processor you want to use.

    Configured but with wrong compiler option "--chip" instead of "-mcpu".
    I've tried to manually change this option in make files, but then there are other errors reported due to wrong use of other options in compile line
     
    Plainly he has defined the chip as a PIC12F629
    It's a faulty XC8 installation causing MPLABX to pass the wrong format command line, so the compiler does not recognise the commands.

    I do also believe this is the problem. I've tried to uninstall all Microchip SW, clean all the caches/folders/registry entries but still MPLAB X uses options meant for older compiler :(
     
     
    #7
    compeoree
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2020/10/07 10:14:06
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/08 06:22:43 (permalink)
    +1 (1)
    I am experiencing this issue as well....thought I was going crazy
     
    I've installed and reinstalled both MPLAB and XC8, multiple times in multiple orders, leaving one or the other or none installed. I've rebooted the PC after install. I've run and updated MPLAB before installing XC8. I copied the steps required to make it work on another PC....no luck.
     
    Creating a new project does not fix it. Copying a project from a working PC does not fix it. It appears as others have stated, this bad install is using parameters for xc8 and not xc8-cc.
     
    Apart from comparing notes on other software (antivirus) installed and OS versions, is there an install log somewhere that may shed some light on the problem? BTW, I'm running Windows 10 Pro 1909 x64 with Sophos AV, and BitLocker turned on.
    #8
    banic
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2007/09/29 06:30:22
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/14 09:11:39 (permalink)
    +2 (2)
    Hello,
     
    I have the same problem with XC8 compiler, MPLABX and Windows 10.
     I installed the latest SW and it does not work.
    Output windows : (2042) no target device specified; use the -mcpu option to specify a target device
     XC16 is working.
     
    post edited by banic - 2020/10/14 09:23:59
    #9
    banic
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2007/09/29 06:30:22
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/15 14:59:31 (permalink)
    +1 (1)
    Hello
    Many years ago I asked for support by email and some person respond me. Now I asked Microchip for support by filling some formk and respond arrived to my email. There were many links to... . One link was to this forum. But nobody respond to my queston at this forum too.
    #10
    ric
    Super Member
    • Total Posts : 28696
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/15 15:07:34 (permalink)
    0
    It appears noone on this forum knows what is wrong with your install.
    Are you allowing it to install where it wants, or forcing it?
    The reported error plainly indicates the compiler doesn't like the command line arguments passed to it.
    It works fine for most people, so we're not sure how to fix it.
     
     

    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!
    #11
    compeoree
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2020/10/07 10:14:06
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/15 18:46:31 (permalink)
    0
    The only "solution" that worked for me was install on a different computer. I installed 3 times on the Win10 Pro machine without success (all default - no options changed), but I installed 3 times on other machines and operating systems and it worked fine.
     
    If I had time or no other computers available to me, I would figure it out. As such, I'm just living with using a different computer for MPLAB. Maybe you can try VirtualBox with Linux guest? I've done that in the past because MPLab screws with the system LibUSB.so files on Linux....really messes up other things that try to use it.
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 18976
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/15 20:46:02 (permalink)
    -1 (1)
    Try clearing both MPLabX Cache folders.  The Paths are listed in the About Box.
    A Clean install is Not clean unless you delete both Folders.
    Find the 2 folders. Close MPLabX, Delete them then reopen it.  You do not need to install it again.
    #13
    Blackwinni
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/10/15 02:34:56
    • Location: Germany
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/15 22:35:26 (permalink)
    0
    Hello,
    i'm facing the same problem. Has anyone solved it yet?
    #14
    compeoree
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2020/10/07 10:14:06
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/16 06:00:36 (permalink)
    0
    Thanks NKurzman, but it didn't work for me. Found the paths (User and Cache) in about and then closed MPLabX. Renamed both of the v5.40 folders to v5.40-del. Started MPLabX, saw the new folders (v5.40) get created, and opened a project, still has the wrong make command....trying to pass '--chip=' instead of '-mcpu' to xc8-cc.exe.
     
    If I go into Tools->Options->Embedded->Build Tools and manually change the 'C Compiler' and 'Assembler' exe from xc8-cc.exe to xc8.exe, create a new project, the build fails with:
     
    :: advisory: (2051) the current license does not permit the selected optimization level, using optimization level 2:: warning: (2055) use of the --mode option is deprecated; use --opt to control optimizations and avoid this warning:: error: (141) can't open cpp.exe command file "C:\Users\COMPE~1xIDI\AppData\Local\Temp\cpp_s4pcx5.cmd": No such file or directory(908) exit status = 1
     
    Wonder if one could find the correct command line and hack the project files to make it work?
    #15
    blazooo
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2020/09/19 08:45:01
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/16 06:41:47 (permalink)
    0
    The only "solution" that worked for me was install on a different computer. I installed 3 times on the Win10 Pro machine without success (all default - no options changed), but I installed 3 times on other machines and operating systems and it worked fine.

    For me works fine on same computer on Virtual Linux OS. So it's something relating to the installation on this OS. An assumption would be that i had previously installed MPLAB 8.89 and then MPLAB X 5.30 which worked fine. I'm also having installed other versions of development tools which have gnu make. Tried to identify which one is used by MPLABX and it is using the version coming by Microchip.
    Further more i've analyzed the make scripts if there's something wrong in them, and realized that the auto-generated makefiles are with wrong parameters which are to be used (--chip instead of -mcpu)
    Tried both ways. Initial install was on default paths, when did not worked, cleaned the cache files (both of them) and installed MPLABX again in new folder without success.

    Cleaned again User/Cache folders and still i have the same problem as well as i can see problems in project preferences.
     
     
    #16
    Murton Pike Systems
    Senior Member
    • Total Posts : 49
    • Reward points : 0
    • Joined: 2020/09/10 02:13:01
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/17 12:35:14 (permalink)
    +1 (1)
    I have found a number of times my project getting corrupted.
    I always keep a backup of a recent working version of my project.
    If I get a problem I load in previously working version and that usually fixes the problem.
    There appears to sometimes be corruption of project files.
     
    Another problem  I sometimes get is compiler hanging for about a minute and each stage MPLAB X goes through it hangs for another minute. Again this is fixed by loading backup.
     
     
    #17
    Lucas Luchiari
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/10/19 12:46:29
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/20 05:28:27 (permalink)
    0
    Hi Guys, I'm facing the same problem! I have done all those procedures indicated by documentation: reinstall, clear cache, etc.. (for both the MPLAB X and XC8) and nothing have changed.


    I tried to debug the problem but I couldn't go further, so I please require dev team to check this point. I have all the logs from MPLAB here if that can help.
    I run microchip from terminal with log flags and the generated file is attached here too (Attachments are not available: Download requirements not met).

    One interesting thing I've noticed is that I'm facing some interface bugs, like I can't change project configuration...when I open the project config the interface window is blank and I get a Java Exception (com.microchip.mplab.nbide.embedded.makeproject.configurations.ui.ConfigurationPanelFeatureToggleModel.showWarningMessageOnNoCompatibleXC8CompilerInstalled(ConfigurationPanelFeatureToggleModel.java:485)). As far as I have read, this new version of MPLAB X 5.40 is using a different java runtime engine, I guess a open source's one, and maybe this leads to some kind of erros, that could be related with this one. (Itried a different version of jre but the error persists).

    I tried to install different versions of MPLAB X and the same error persists. I tried to install in a different computer with the same procedures and same versions and that worked! What leads me to think that maybe this is a machine related problem. So here is my computer config...

    OS: Windows 10 Pro 64 bits (ver. 1909)
    Processor: AMD Ryzen 5 3400G With Radeon Vega Graphics 3.7 GHz
    16GB RAM

    I hope this could help and provide dev team more information to support us, and if they need anything I could provide, I'd be glad to help.

    Attachment(s)

    Attachments are not available: Download requirements not met
    #18
    Lucas Luchiari
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/10/19 12:46:29
    • Location: 0
    • Status: offline
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/20 09:03:43 (permalink)
    +1 (1)
    guys.. I reinstalled XC8 on version 2.10 and worked!
    One thing I noticed was that ver. 2.10 was installed on "Program Files(x86)" and version above was installed on "Program Files". But this worked for me, even interfaces bugs are working now.
    #19
    ric
    Super Member
    • Total Posts : 28696
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Compile problems with XC8 and MPLAB X 5.40 2020/10/20 12:12:20 (permalink)
    +1 (1)
    That is a side effect of the latest version moving to a fully 64 bit version.
     

    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!
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5