• AVR Freaks

Hot!Standard libraries not found when clean building and no error is thrown

Author
MJN
New Member
  • Total Posts : 17
  • Reward points : 0
  • Status: offline
2015/12/01 13:06:52 (permalink)
0

Standard libraries not found when clean building and no error is thrown

Compiler V1.21 reports a successful build but when browsing some header files I found some of the included header files that are a standard part of the compiler are not found.
#include <string.h>
#include <stdlib.h>

Since these libraries are in a couple different directories in the compiler install, how do I specify which one to default to?
 
Summary from Discussion:
IDE can't find the files but the compiler does -> IDE bug -> red underline error indication of the IDE is misleading/unreliable and causes users to waste time looking at false errors.
Always audit the paths when changing compiler versions. Failing to do so may result in using libraries from the previous compiler with the newest version.
 
Open questions:
Given there are multiple sets/folders of libs and includes for a compiler distribution:
  1. Does the compiler default to a specific location for libs and include files (say C:\Program Files (x86)\Microchip\xc32\v1.21\pic32-libs\include)?
  2. If there is a default location for the libs and includes, is this overridden when the path to an alternate set added in the IDE environment?
post edited by MJN - 2015/12/02 10:21:12
#1

14 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17611
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 13:13:49 (permalink)
    +2 (2)
    The Compiler and the IDE Are different.
    Just because the IDE can't find it, does not mean the compiler did not.
    What version of MPLab?
    #2
    MJN
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 13:21:58 (permalink)
    0
    X IDE v3.15
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 17611
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 14:27:37 (permalink)
    +1 (1)
    Not Found as red lines under them?
    That they do not Click?
     
    Check the Paths in MPLab X
    #4
    MJN
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 14:59:13 (permalink)
    0
    Red lines are there but I only found them by chance and am left wondering where else this problem exists for these and potentially other header files that are not being found. 
     
    I'm looking for a compile time failure report and was expecting it to show up in the output window of the IDE but instead I find
    BUILD SUCCESSFUL (total time: 7s)
     
    Is there some-where else I should be looking?
     
    I see there is the ability to set included paths in X IDE under the project properties->xc32-gcc->pre-processing and messages->include directories but it seems this is intended for custom header files since they are relative to the project rather than compiler library headers which will change when I update the compiler (I can see overlooking this when upgrading the compiler). It seems these standard compiler libraries and includes should be relative to the compiler installation so upgrading and overlooking a change to this path does not result in using older libraries with the newer compiler.
     
    Is there another place for compiler related libraries and includes that is relative to the library installation location?
     
    #5
    ric
    Super Member
    • Total Posts : 23211
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 15:01:23 (permalink)
    +2 (2)
    marknohr
     
    I'm looking for a compile time failure report and was expecting it to show up in the output window of the IDE but instead I find
    BUILD SUCCESSFUL (total time: 7s) 


    The compiler and the IDE use their own rules for finding the files.
    As you've found, the IDE can be a bit flakey. Often totally shutting down MPLABX and restarting it can clear these errors.
    The build log is the final authority. If it says "BUILD SUCCESFUL", then it is the IDE at fault.
     

    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
    MJN
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 15:16:55 (permalink)
    0
    ric,
    Thanks for the input. If the build log is the final authority, where else can I look to verify it's not lying to me?
     
    Having errors or a unresponsive environment requiring a restart at least can be noticed but build successful and no errors and you don't even know there is anything to be done.
     
    I checked and the elf and hex files are being generated as if the compiler is fine with the build.
     
     
     
    #7
    ric
    Super Member
    • Total Posts : 23211
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 21:34:37 (permalink)
    +1 (1)
    marknohr
    ric,
    Thanks for the input. If the build log is the final authority, where else can I look to verify it's not lying to me?
     ...

    I don't fully understand the question.
    The build log IS the final authority. Look there.

    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!
    #8
    MJN
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 22:55:04 (permalink)
    0
    Sorry. I'm not being clear. 
    The IDE is telling me a few include files are not found by means of a red underline. This I only found by chance when perusing the source file with the include files underlined in red. 
     
    Yet the output window in the IDE gave no indication these files could not be found instead indicating everything is compiling just fine. 
     
    I guess I'm to assume the compiler found the include files and used them since the compiled outputs were generated. Looking to verify the compiled outputs were being generated was one possible answer to my earlier question.
     
    So its just that the IDE is tagging files that it cannot find irrespective of whether the compiler can find them? If so this seems to be a bug in the IDE as, being an interface to set compiler options,  it should be in sync with the compiler. No?
     
    What I'm hearing ric say is If the compiler could not find the files it would have assuredly been reported in the IDE's "output" window. Do I have this right?
     
    I'm wondering how the compiler knows which of these same named include files to use since there are 4 locations under the compiler that has them. Is there a default selection that gets overridden if there is an explicit path set the IDE?
     
    #9
    NKurzman
    A Guy on the Net
    • Total Posts : 17611
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Standard libraries not found when clean building and no error is thrown 2015/12/01 23:15:12 (permalink)
    +2 (2)
    MPLab X has long standing issues with the red underlines.
    Some times closing and opening the program fix it. Some times a system reboot. And other times they just stay for no appearent reason.
    Note sometimes it is scanning the project. (Bottom right) during this time it may not have enough info to be accurate.
    #10
    DickD
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2013/10/27 19:06:27
    • Location: Whidbey Island, WA
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2019/05/21 11:20:48 (permalink)
    0
    I didn't have this problem with 5.15, but I just upgraded to MPLAB X IDE 5.20 and the problem occurs. Rebooting doesn't help. Restarting the IDE doesn't help. Clean build and then restart the IDE doesn't help.
     
    The build log (compiler build) is fine.  The compiler finds the #include <stdlib.h> and the like. But the IDE underlines all these includes and <stdint.h> types like uint8_t are flagged as undefined.
     
    What do I change in 5.20 to fix this so it behaves like 5.15 and "finds" the standard include files?
    #include <stdint.h>
    #include <stdlib.h>
    etc.

    The path to the XC32 compiler is present in both 5.15 and 5.20. I'm using XC32 version 1.44.  This path is to a .bin directory. I didn't see a way to tell the IDE the compiler's standard include path.  It's not relative to the project directory, it's relative to the compiler's directory.
     
    Dick
    #11
    rangel
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2015/02/24 08:21:23
    • Location: 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2019/05/23 13:59:05 (permalink)
    0
    Hi,
     
    The link below worked for me.
     
    https://microchipdeveloper.com/xc16:set-the-include-directory-path
    Only select the include directory installation folder of XC16 on your computer.
    And maybe need to reinitialize the mplab program.
     
     
    My project buid ok, but Mplab 5.20 dont found atof() function yet.
     
    Atof() stay greyed on "stdlib.h".
     
    I am using XC16 1.36b and Mplab 5.20.
     
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 17611
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: Standard libraries not found when clean building and no error is thrown 2019/05/23 14:05:06 (permalink)
    0
    Incorrect Red squiggly underlines are a common compliant for MPLabX.
    There are only temporary fixes for the issue.
    #13
    Charlie E
    Junior Member
    • Total Posts : 72
    • Reward points : 0
    • Joined: 2009/08/24 14:20:00
    • Location: 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2019/08/02 11:29:28 (permalink)
    0
    I am having the same problem in X5.20.  Not only do I have the squigglies for the include files, I also have them for the functions that are included in them.  When you find a REAL issue, it makes it so much harder to resolve when you are trying to tell the real errors from the IDE bug caused errors...
    #14
    LdB_ECM
    Senior Member
    • Total Posts : 125
    • Reward points : 0
    • Joined: 2019/04/16 22:01:25
    • Location: 0
    • Status: offline
    Re: Standard libraries not found when clean building and no error is thrown 2019/08/02 20:19:56 (permalink)
    +1 (1)
    If it annoys you that much
    Main menu - Tools => Miscellaneous => Files => untick Enable auto-scanning of sources
    No more red lines on the IDE
     
    Alternatively hook up a different IDE like VSCODE from microsoft.
    #15
    Jump to:
    © 2019 APG vNext Commercial Version 4.5