Netbeans 7.2 shows “Unable to resolve identifier” , although build is successful

后端 未结 11 570
野的像风
野的像风 2020-11-28 21:54

I\'m using the Netbeans IDE 7.2 with C/C++ plugin (last version 1.18.1.1) and if I build my project everything is fine but the IDE show me

11条回答
  •  情歌与酒
    2020-11-28 21:59

    I often have this error, and as others mentioned, usually I add space character, save the file, remove the space character... and all identifiers are solved.

    This time it did not work. My project, which I compiled thousand times, and it always worked, suddenly crashed MPLAB X IDE v3.35 (Mac OSX, but likely it doesn't matter), while typing text. After this I have in one file only and for one structure only, all identifiers unresolved.

    Structure in profile.h file was:

    typedef struct
    {
        int state;                      ///< state machine current state
        int enabled;                    ///< machine can be ENABLED or DISABLED
        int flag;                       ///< to initiate profile execution
       ... many variables here ...
        unsigned long timestamp;        ///< variable used for local timing
    } profile_struct;
    

    In my profile.c file any variables from this structure became unresolved, but project compiled and worked fine.

    After a frustrating hour of trying, this solved my problem: Erased the whole MPLABX cache directory.

    In my case, it is located at:

    /Users/USER_NAME/Library/Caches/mplab_ide/dev/v3.35/var
    

    (need to erase the whole 'var' directory; and of course replace the USER_NAME with your user name)

    Note, that the 'Library' is a hidden directory, but you can still access it if you enable viewing hidden files, or go straight to it via terminal.

    Lastly, on your computer it might be somewhere else. I found mine by watching, which files were modified on my computer in the last 2 minutes, by using the terminal command:

    /usr/bin/find /Users/USER_NAME/ -mmin -2 –ls
    

提交回复
热议问题