You should check the GCC manual but I doubt that it has such a feature. Because a preprocessor is a lot different to Java import, it probably isn't really feasible in general to do this sort of checking, but I may be wrong.
----- Original Message -----
From: mike white
Sent: Monday, March 01, 2004 2:45 AM
Subject: [Mingw-users] "include scrubber"



  Does g++ have a way to determine if include’s don’t need to be there? If not, does anyone know of a tool that can help me do this?


For example, say I have code that looks like this:


#include <iostream.h>

#include <math.h>

#include <vector>

#include <string>


int main ()


   cout << “hello world” << endl;

   return 0;




I wanted to use a tool that would tell me that math.h, vector, and string are included but don’t need to be. Something like how the eclipse java ide does with imports? Is there a way to turn on this as a warning in g++?