title: Generic solution to Eclipse CDT's symbol 'X' could not be resolved?
body: <p>I have a project with C++ and C files. The code compiles and runs correctly, but I need to get rid of the following error:</p>
  
  <blockquote>
    <p>Symbol 'ERANGE' could not be resolved</p>
  </blockquote>
  
  <p>I was able to reproduce it with these two files (latest x64 Elipse Juno on Ubuntu):</p>
  
  <p>main.h:</p>
  
  <pre><code>#ifndef MAIN_H_
  #define MAIN_H_
  
  extern "C" {
  #include &lt;errno.h&gt;
  }
  
  #endif /* MAIN_H_ */
  </code></pre>
  
  <p>main.cpp:</p>
  
  <pre><code>#include &lt;cerrno&gt;
  #include &lt;cassert&gt;
  #include "main.h"
  
  int main(int argc, char * argv[]) {
      assert(errno != ERANGE); // &lt;-- CDT ERROR here
      return 0; }
  </code></pre>
  
  <p>Doing <em>Open Declaration</em> on ERANGE correctly takes me to /usr/include/asm-generic/errno-base.h file.</p>
  
  <p>The following workarounds to similar issues DID NOT work:</p>
  
  <ul>
  <li>Setting <em>Indexer -> Use active build configuration</em></li>
  <li>Manually adding the ERANGE symbol to project <em>Paths and Symbols</em></li>
  <li>Adding main.cpp to <em>Preferences -> C/C++ -> Code Analysis -> Symbol is not resolved -> Customize Selected... -> Scope -> Exclusion patterns</em></li>
  </ul>
  
  <p>The only solution that will work is disabling the <em>Symbol is not resolved</em> error completely, but that will cause me to miss real issues.</p>
  
  <p><strong>Edit:</strong>
  CDT bug filed <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=404017" rel="nofollow">https://bugs.eclipse.org/bugs/show_bug.cgi?id=404017</a></p>