質問

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

役に立ちましたか?

解決 3

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.

他のヒント

I had quiet similar problem, in my case changing toolchain from Linux GCC to Cross GCC in project properties (C/C++ Build -> Tool Chain Editor -> Current toolchain) resolved the issue

In the project settings go to "C/C++ Build > Tool Chain Editor". The selected tool chain was empty in my case. Thus I selected the tool chain that I use (which seems to be "Cross GCC" in your case). This will set the ${COMMAND} variable (and ${FLAGS} and ${INPUTS}), which seems to be unset in your case. If you for example close the project and reopen it the error should be gone.

The second option I see is that the command with which Eclipse determines the default definitions and include paths of your compiler/tool chain got screwed up when you "tweaked your project". You should be able to fix this as follows: Open the project settings and go to "C/C++ General > Preprocessor Include Paths, Macros etc.", select the "Providers" tab, select the active "CDT * Built-in Compiler Settings" provider from the list and make sure that the "Command to get compiler specs" starts with '${COMMAND} -E' instead of '-E'. In my case the complete line is '${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"'. If you no longer want to see the output when Eclipse is executing this command you can uncheck "Allocate console in the Console View".

Are you using GCC Compiler for ARM ? In that case you should install ARM Eclipse plugins from http://gnuarmeclipse.livius.net/blog/

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top