5

All of our C++ headers use a .h extension. Eclipse thinks these are C headers and flags them with lots of syntax errors on things like classes and namespaces.

I've tried to change the file type association from:

Preferences > C/C++ > File types

but it's "locked".

Interestingly, "*.h" is associated with both C and C++ headers, but it seems to be using C. How can I get Eclipse to treat .h files as C++?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Fred Larson
  • 60,987
  • 18
  • 112
  • 174

1 Answers1

2

Try creating a new project and specify your source area as the location. However, be sure you select C++ project (I usually use the makefile option). This is all you should have to do in order to make the parser recognize C++ syntax.

AdamC
  • 16,087
  • 8
  • 51
  • 67
  • Another factor is that all the source files are accessed through RSE. I figured out how to import files to a project via RSE, and then this solution worked. Thanks! – Fred Larson Oct 22 '08 at 18:37
  • ... except that once I import them into a project, they seem to be local copies and don't sync via RSE anymore. Rats. – Fred Larson Oct 22 '08 at 19:08
  • Found the answer. Instead of importing the files, link an RSE folder to the project. – Fred Larson Oct 22 '08 at 19:53