0

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?

Bennett
  • 317
  • 2
  • 6
  • 16
  • `Symbol cout could not be resolved` is a compiler error. Hence, eclipse has located the compiler. I think you are missing the necessary include directories for `std`. – Chris Dargis Jan 07 '13 at 20:05
  • What is show in build console when you try to build? – dbrank0 Jan 07 '13 at 21:32
  • @DougRamsey - It looks to me like these are errors from Eclipse's on-the-fly code analysis, not compiler errors. – Josh Kelley Jan 07 '13 at 22:30

1 Answers1

2

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.)
Community
  • 1
  • 1
Josh Kelley
  • 56,064
  • 19
  • 146
  • 246