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

后端 未结 11 537
野的像风
野的像风 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:55

    Mine worked once i renamed my main.c to main.cpp.

    Based on the file extension, the behavior of Netbeans Code Assistance changes

    0 讨论(0)
  • 2020-11-28 21:56

    Here's an excerpt from my answer to another question.

    Unresolved Identifier

    If the source of the .cpp file looks like this

    enter image description here

    Click with the right mouse button on your project.
    Check C/C++ Code As...
    Run Reparse Project.

    enter image description here

    If that is not enough.
    Go to Project Properties
    Fill in the Include input field as described.

    enter image description here

    Set the include path correct.

    I hope that can help you.

    0 讨论(0)
  • 2020-11-28 21:57

    i had the same problem, but i recognized it appears after i changed properties-> c++ compiler -> Compilation Line -> additional options to -std=c++11. if change the settings to default the error "unable to resolve identifier" disapears.

    0 讨论(0)
  • 2020-11-28 21:57

    try Click by Right button the file, Properties->General->Exclude from code assistance (disable)

    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-11-28 22:03

    I am using NetBeans 8.1 and the same problem popped up when I started a new C++ project. It solved itself after running the project through the debugger.

    0 讨论(0)
提交回复
热议问题