0

We have a C++ project we want to enhance using Eclipse on Linux (CentOS 7). We have one Linux VM with Eclipse and CDT (a C++ plug-in) installed. Using CMake, we generated make files for the project and brought it up in Eclipse (File → Import → General → Existing Projects into Workspace). From there we need to do some fixes to make it compile C++ 11 code. We do this via the "Properties → C/C++ General → Preprocessor Include Paths, Macros etc." page. It all builds and works fine.

We created new Linux VMs with the same version of Linux. We installed Eclipse (Oxygen) and installed the CDT plug-in. We followed all the same steps as above, except in these new VMs, there is no "C/C++ General → Preprocessor Include Paths, Macros etc." option in the Properties dialog. We can get the code to compile as C++ 11, but the IDE itself doesn't recognize C++ 11 and marks most of the code as errors. If we had the "Preprocessor Include Paths, Macros etc." page, we could makes the necessary changes, but for the life of us, we can't figure out why it doesn't show up in the new VMs. Both Eclipse installs have the same plug-ins (one, namely, CDT).

Is there something we're missing? Is there another way to access the options that the missing page allows?

UPDATE Perhaps some visual will help. Here is what the Properties page looks like when opened on the original Linux VM:

enter image description here

Here is what the Properties page looks like when opened in the new VMs: enter image description here

As you can see, in the second image, there is no "Preprocessor Include Paths, Macros, etc." option underneath "C/C++ General". That is the problem. Without that page, we can't do several things to the project we need to to get it to operate correctly.

Frecklefoot
  • 1,660
  • 2
  • 21
  • 52
  • 1
    See if this helps: [Eclipse CDT C++11/C++0x support](https://stackoverflow.com/q/9131763/10077) – Fred Larson Apr 04 '18 at 20:06
  • 1
    I think you imported the project wrong. Check the .project or .cproject files in the project folder. Compare the files from both VMs – Thomas Sablik Apr 04 '18 at 20:09
  • Thanks, Thomas. We imported the exact same files into both Eclipse installs. – Frecklefoot Apr 04 '18 at 20:30
  • Thanks, Fred. A lot of the recommendations require the C/C++ Build pages, which we also don't have. The other page requires changes to the "Properties->C/C++ Build->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags" page, which is also missing for us. – Frecklefoot Apr 04 '18 at 20:41
  • Have you tried the suggestion from the question Fred linked, to modify the "Command to get compiler specs" (first part of [this answer](https://stackoverflow.com/a/24561615))? This is the most reliable method in my experience. – HighCommander4 Apr 05 '18 at 01:27
  • Thank you, @HighCommander4. I did follow those steps, and had high hopes for them. However, the "Properties -> C/C++ General -> Preprocessor Include Paths, Marcos etc." submenu doesn't show when we import it into Eclipse. That menu is needed for the step that says "This is important". I think importing it in a manner where Eclipse actually thinks it's a C++ project is key here. – Frecklefoot Apr 05 '18 at 15:23
  • I added images to my original question for clarification. – Frecklefoot Apr 05 '18 at 20:32
  • I may have an idea as to what's going on. When creating the project, instead of doing "File -> New -> C/C++ Project", can you try doing "File -> New -> Other -> C/C++ -> C++ Project" (note: *not* "C/C++ Project")? The resulting project should have the missing preference page. – HighCommander4 Apr 13 '18 at 17:30
  • We imported the existing project from a directory, we didn't create a new project. All we can figure is that there's a bug in the current version of Eclipse. We just downloaded an older version of Eclipse Oxygen, and it imports the project perfectly. It feels like taking a step backwards, but it's the only thing we could get to work. – Frecklefoot Apr 13 '18 at 23:51

1 Answers1

0

I can't really be proud of our solution to this problem. The version of Eclipse that works is Oxygen.1a Release (4.7.1a). The "latest and greatest" release of Eclipse (at the time) was Oxygen.2 Release (4.7.2). We downloaded and installed 4.7.1a and it worked. There must be a defect in 4.7.2 that prevents it from correctly recognizing C++ 11 code.

Oxygen.1a 4.7.1a imports the project perfectly and shows up all the options we need to make changes and get the application to compile and run correctly.

Frecklefoot
  • 1,660
  • 2
  • 21
  • 52