Search code examples
eclipseeclipse-cdt

Eclipse CDT - "Program "-E" not found in PATH


This is driving me NUTS. I recently tweaked around with my C Project's:

C/C++ General ->Paths and Symbols->Includes->GNU C->Include Directories.

Now, I get the following Error listed:

Program "-E" not found in PATH

Location: Project Properties, C++ Preprocessor \
          Include.../Providers, [CDT Cross GCC Built-in \
           Compiler Settings] options

Short of making a new Workspace and starting over, what the heck does this mean, and how do I fix my current project???

Note

Closing Eclipse, Checking out the project from Source-Control Fresh, and restarting still shows the problem!!! How the heck can this be.

-Justin


Solution

  • I have had this problem for months and finally found a solution for my Eclipse. I noticed that this problem appeared in some of my projects but not in all of them, and after checking the .cproject options I realized that somehow Eclipse is using some variables that are either not defined or not expanded properly, in my case ${CXX} and ${CC}.

    So my solution is to go to Preferences > Run/Debug > String Substitution and create two string substitution variables:

    • CC=gcc
    • CXX=g++

    Clean the errors from the console, restart Eclipse and the errors are gone.

    Hope that helps.