title: Eclipse Indigo CDT: Function could not be resolved
body: <p>This feels silly, but its been 2 days...somewhere after upgrading from Ubuntu 10.04 to 10.11 and from Eclipse Helios to Eclipse Indigo, I got stuck with the following problem:</p>
  
  <h1>Problem Description:</h1>
  
  <p>I'm trying to use a function in math.h called isinf(), but the problem also occurs with things like isnan().<br/> The program compiles fine on the command line using make and fine in eclipse using build.<br/>  But if I open the program file in eclipse it reports that it cannot reolve the isinf() function call.<br/>  If I just insert the program contents into a new project and new source file, the error appears immediately.<br/>  This problem did not occur under 11.04 with Eclipse Helios CDT</p>
  
  <h2>Questions:</h2>
  
  <p>Why are these errors only reported when the program file is opened and not on when the program is compiled; why are the errors not detected make is run from the command line?<br/> Is there a solution/workaround available?</p>
  
  <h2>Version Info</h2>
  
  <p>Linux Ubuntu 10.11 64-bit<br/> 
  Eclipse CDT Indigo, Service Release 1, Build id: 20110916-0149<br/> 
  (Also using Eclipse EE Indigo – if that makes a difference)<br/> 
  GNU Make 3.81<br/> 
  gcc 4.6.1-9Ubuntu3<br/> </p>
  
  <h2>To Duplicate:</h2>
  
  <p>Please find the two files you'll need to replicate below:</p>
  
  <p><strong>Step 0.</strong> Verify that everything is fine outside of Eclipse<br/> 
  Copy the attached source file and make file<br/> 
  create a directory e.g. Mkdir FunTest<br/> 
  Save the source file a 'Test.cpp' and the makefile as 'makefile'<br/> 
  Open a command prompt and navigate to the directory e.g. FunTest<br/> 
  Enter 'make' <br/> 
  Enter ./TestOut <br/>
  Program responds “is not infinite”<br/> 
  <br/> </p>
  
  <p><strong>Step 1.</strong> Create the project in Eclipse<br/> 
  Open Eclipse<br/>
  Select File|New|MakeFile Project with Existing Code<br/> 
  Click Browse – navigate to the directory (FunTest) and click ok<br/> 
  Select 'Linux GCC' from the Toolchain selector<br/> 
  Click Finish<br/> </p>
  
  <p><strong>Step 2.</strong> Find the Error<br/> 
  Click Build All (Ctrl-B) – project builds without errors<br/> 
  Open the project in the project explorer to display the file in the directory<br/> 
  Double click on the file “Test.cpp”<br/> 
  Note the error icon next to line testing for infinity<br/> 
  Note the 2 error messages:</p>
  
  <pre><code>Semantic error: Function _isinff could not be resolved 
  Semantic error: Function _isinfl could not be resolved
  </code></pre>
  
  <p><strong>Test.cpp:</strong></p>
  
  <pre><code>include &lt;math.h&gt;
  
  int main(int argc, char **argv)
  {
  
  int TestNum = 10;
  
  if (isinf(TestNum) == 0)
      printf("Not infinite\n");
  
  
  return 0;
  
  }
  </code></pre>
  
  <p>makefile:</p>
  
  <pre><code># Specify the compiler
  CC = g++
  
  # Specify the compiler flags
  CFLAGS += -c
  
  # Specify the files making up the application
  SOURCES = Test.cpp
  OBJECTS = $(SOURCES:.cpp=.o)
  EXECUTABLE = TestOut
  
  all: $(EXECUTABLE)
  
  $(EXECUTABLE): $(OBJECTS)
      $(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@
  
  .cpp.o:
      $(CC) $(CPPFLAGS) $(CFLAGS) $&lt; -o $@
  
  install:
      @echo "Build complete!"
  </code></pre>