Eclipse CDT complains about unresolved functions but still builds successfully

11,294

Solution 1

I had the same problem with my Juno Release, Build id: 20120510-1218 on Fedora 14. To solve the index problem: Navigate to preferences -> c/c++ -> Editor -> Indexer -> uncheck "Allow heuristic resolution of includes"

-All the best

Solution 2

At preferences -> c/c++ -> Editor -> Indexer disable indexer, apply, go back to preferences, and enable index again. This makes Eclipse to re-index the workspace. After that, my false red signs on the right side of the editor were gone.

Share:
11,294
curvedvision
Author by

curvedvision

Updated on June 17, 2022

Comments

  • curvedvision
    curvedvision almost 2 years

    The following C++ application compiles and runs successfully within Eclipse CDT but the IDE is still reporting an error stating:

    Could not resolve function wprintf
    
    #include <stdio.h>
    #include <wchar.h>
    
    int main()
    {
      wprintf(L"Hello world");
      return 0;
    }
    

    The directory /usr/include (where wchar.h resides) is definitely listed within the Include path as otherwise the application would not compile. Hitting F3 on wprintf reports:

    Could not find symbol 'wprintf' in index
    

    This is my set up:

    • openSUSE 11.4
    • Eclipse IDE for Java Developers (Indigo Service Release 2 - Build 20120216-1857)
    • Eclipse CDT v8.0.2.201202111925

    Does anyone know how I can get Eclipse CDT to resolve this function correctly?

  • curvedvision
    curvedvision about 12 years
    I've checked and /usr/include is listed within the Include directories for both GNU C and GNU C++.
  • Christoph
    Christoph about 12 years
    strange, I use the same CDT version, but don't have these options, only C/C++ -> Indexer - enable indexer (but no way to select full or otherwise), and no indexer category in C/C++ -> Editor