Bennett
Bennett

Reputation: 317

Eclipse not recognizing my GCC

I believe Eclipse is not recognizing my gcc compiler, as I'm getting errors for things that are definitely not errors, such as Symbol cout could not be resolved

http://img94.imageshack.us/img94/1264/gcc.png

Did I edit the PATH file incorrectly?

Upvotes: 0

Views: 789

Answers (1)

Josh Kelley
Josh Kelley

Reputation: 58352

There are a few different issues here:

First, #include <iostream> is a preprocessor directive, not a C / C++ statement, so it doesn't need a trailing semicolon.

Second, unresolved symbol errors within Eclipse don't necessarily have anything to do with your compiler and don't necessarily stop compilation. Eclipse can automatically use your GCC compiler to find include paths, etc., which it then uses to resolve symbols. In my experience, this feature of Eclipse is extremely nice when it works, somewhat brittle and opaque when it doesn't work, and completely magical at all times.

I'd recommend taking this one step at a time:

  1. Fix your #include.
  2. Figure out why gcc doesn't work from the command line. Maybe you need to restart cmd.exe after editing the path. Maybe your PATH variable is too long. Maybe a nicer environment editor would help as you're investigating this.
  3. Build your project from within Eclipse. This will test if your basic compiler + IDE toolchain is working and will help Eclipse do its automagical symbol and header resolution.
  4. If you're still having problems with Eclipse's symbol and header resolution at this point, then you can work on that specifically. (For example, you may need to manually set #include paths within Eclipse's project settings, or you may find that cleaning your Eclipse index helps.)

Upvotes: 2

Related Questions