• AVR Freaks

Helpful ReplyHot!"Unable to resolve identifier..." message

Author
RobL12
Junior Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2015/06/11 06:22:41
  • Location: 0
  • Status: offline
2015/06/17 08:17:50 (permalink)
0

"Unable to resolve identifier..." message

So last nite, I was in the middle of a debug session when I called it quits.  I made sure that I saved all my files and locked my computer.  When I came in this morning, I noted that Windows took it upon itself to install some update and reboot my system.  When I launched MPLABx, I noticed that my source file was now bleeding with "Unable to resolve identifier xxxx" messages. 
The file still compiles and links fine (as it did when I left it).  Looking closer, it seems that the symbols that its having issues with are structures that I have defined and typedef'd in a header file.  It seems as though the identifier resolution and code completion suggestions are connected.  Here are some things that I have tried:1) If I cntl-click on a structure typedef name in the .c file, the IDE takes me to the structure definition in the header file
2) If I use the typedef name and a component selection, the IDE will suggest members
3) If I create an instance of the structure with the typedef and then try to select an element of the instance, the IDE provides no suggestions
4) If I change the name of the structure in the header file (say append a '1'), creating an instance of the new structure allows the IDE to parse properly.
5) I copied the entire project and moving to a linux vm with MPLABx.  The linux version parsed everything correctly.
6) I copied the working linux project back to the windows platform and the windows system reacted the same as before
7) I've restarted MPLABx (multiple times).  I've rebooted the computer.
8) I've closed and reopened the project.
9) I've deleted and re-added the header file with the offending structures.
When I opened the project into the linux machine, I noticed that there was a delay and status bar as the system parsed the project.  So after this, I'm wondering if there is some way that I can force the windows system to re-parse the entire project?  Maybe delete a file in the project?  Any thoughts would be appreciated.
 
Here's my system info:

Product Version: MPLAB X IDE v3.00
Java: 1.7.0_67; Java HotSpot(TM) 64-Bit Server VM 24.65-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_67-b01
System: Windows 8.1 version 6.3 running on amd64; Cp1252; en_US (mplab)
XC32 (v1.34) compiler.
#1
Aussie Susan
Super Member
  • Total Posts : 3591
  • Reward points : 0
  • Joined: 2008/08/18 22:20:40
  • Location: Melbourne, Australia
  • Status: offline
Re: "Unable to resolve identifier..." message 2015/06/17 19:32:55 (permalink)
-3 (5)
If the file compiles and links then that is all you need to worry about.
The source parser in the IDE can sometimes (often) get confused and throw errors. However, if the compiler is happy then you should be happy.
Susan
#2
RobL12
Junior Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2015/06/11 06:22:41
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2015/06/18 08:06:48 (permalink) ☄ Helpfulby Chaabane 2017/05/31 05:20:50
+9 (9)
Sorry, the IDE is a tool that is supposed to help us.  Code completion, error flags, etc are all features that make the environment worth using.  Otherwise, we could just go back to notepad and the command line.
 
For everyone else, the real solution to my issue was in the cache. 
My cache dir was located off of my user dir.  ..\appdata\mplabx\var\cache.
You can find the path from Help | About.
I closed all projects and MPLABx and then deleted the cache directory altogether.
When I launched and reloaded, MPLABx reparsed the project and all the 'errors' went away.
 
** I do not know whether this can adversely affect the project/configuration in other ways.  So far, its been working fine for me.  I suspect that deleting the cache is safe, but use at your own risk.  You may want to backup the userdir before attempting.
#3
XGenerator
Administrator
  • Total Posts : 350
  • Reward points : 0
  • Joined: 2009/10/12 12:11:03
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2015/06/18 08:55:07 (permalink)
0
We are looking into these types of issues, trying to determine the root cause. We agree they should be resolved.
If you force the make files to be re-generated by opening the project porperties, change the debug tool to simulator for example, click Ok. Then re-open and change back to the original debug tool and click ok. Does this help?
 
#4
RobL12
Junior Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2015/06/11 06:22:41
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2015/06/18 09:53:31 (permalink)
+1 (1)
Since I had deleted the old cache directory,  I pulled it from the recycle bin and verified that I was still seeing the parsing issue.
I switched the debugger tool to the simulator and switched back as suggested- no change.
I also switched to simulator, closed MPLABX, reopened and switched back to the ICD- no change.
 
Once I was done, I switched back to my new cache directory and everything is being resolved as expected.
#5
MJBehrens
New Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2013/08/28 18:33:35
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2016/06/07 22:41:34 (permalink)
+2 (2)
I have just experienced the same problem with v3.20 which manifested after a windows reboot overnight.
 
Renaming the Cache (to CacheBackup) worked for me.
 
Thanks
#6
alex.h
Starting Member
  • Total Posts : 31
  • Reward points : 0
  • Joined: 2016/07/27 07:09:53
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2016/08/18 00:34:32 (permalink)
+1 (1)
Hi,
 
I had the problem a few weeks ago with just one structure. Renaming it solved the Problem.
Right now all my structures seem to have the problem. All these pseudo errors are irritating and disturbing. It would be stupid to rename all my structures...
 
Where is the Cache located that you are talking about? Is it a project folder?
#7
alex.h
Starting Member
  • Total Posts : 31
  • Reward points : 0
  • Joined: 2016/07/27 07:09:53
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2016/08/18 03:37:57 (permalink)
+2 (2)
...first read, then wright.
RobL12
...
My cache dir was located off of my user dir.  ..\appdata\mplabx\var\cache.
You can find the path from Help | About.
...



#8
sparkcatcher
New Member
  • Total Posts : 3
  • Reward points : 0
  • Joined: 2008/05/24 10:20:53
  • Location: California
  • Status: offline
Re: "Unable to resolve identifier..." message 2017/05/23 14:47:11 (permalink)
+1 (1)
Many thanks to RobL12.
I experienced the exact same issue.   I'm not a pro with MPLAB so I figured I mis-typed something.  It took me two days to try different things and then I found this forum post.   After backing out all my attempts to correct the issue, I followed RobL's advice and renamed the cache directory.
 
I reloaded the project and after a few minute of "scanning" and "parsing" messages, the project loaded again with no IDE error messages.   The cache was reconstructed.   My project continued to build ok even with all the error messages but the IDE must be consistent with the compiler or you'll never be sure that you don't have a hidden error.
 
The MPLAB IDE is such a great tool, an excellent productivity enhancer.    I hope they can find a way to tell when the IDE cache corrupts.  I'm not sure if this happens a lot, but issues like this leave the impression that the tool is fragile and this scares away developers.
 
Also Microchip needs to elevate this solution because this thread is very difficult to find unless you enter the exact search terms in google.
 
Again, thanks to RobL.
 
#9
sjb741
Super Member
  • Total Posts : 805
  • Reward points : 0
  • Joined: 2010/01/25 08:45:39
  • Location: 0
  • Status: offline
Re: "Unable to resolve identifier..." message 2019/06/17 06:15:07 (permalink)
0
Same issue with 5.20, and this is an actual nuisance because I cannot make the 'breakpoint' pink square appear on a line with the warning "red blob".
 
- Of course, I will be trying the above cache manoeuvre.
#10
Jump to:
© 2019 APG vNext Commercial Version 4.5