Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328472

Summary: "C/C++ Build" does not show under Preferences
Product: [Tools] CDT Reporter: Nikolaus Rath <Nikolaus>
Component: cdt-buildAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, cdtdoug
Version: 7.0.1   
Target Milestone: 7.0.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
screenshot
none
screenshot 2
none
.metadata/.log
none
Fix enablement expressions aleherb+eclipse: iplog-

Description Nikolaus Rath CLA 2010-10-22 09:06:51 EDT
When I right click on my project in the project explorer, and select "Properties", then the menu on the left of the dialog does not include the "C/C++ Build" entry. When I use the menu bar to select Project -> Preferences, the "C/C++ Build" enty is included.

Eclipse Version: Helios Service Release 1
Build id: 20100917-0705.
Comment 1 Andrew Gvozdev CLA 2010-10-22 09:48:53 EDT
(In reply to comment #0)
> When I right click on my project in the project explorer, and select
> "Properties", then the menu on the left of the dialog does not include the
> "C/C++ Build" entry.
What entries do you see there? Can you attach a screenshot?

> When I use the menu bar to select Project -> Preferences,
> the "C/C++ Build" enty is included.
Is it "Project -> Properties" or "Window -> Preferences"? Are you sure the same project was selected when you used that. Maybe multiple projects got selected? Is it reproducible?
Comment 2 Nikolaus Rath CLA 2010-10-22 10:36:01 EDT
Yes, it is reproducible. 
Yes, it is the same project. Screenshot is attached, dialog1.jpg shows the dialog after right clicking on the project, dialog2.jpg is the dialog when selected over the menu bar. Note that the project name is missing in the title bar of the first dialog.
Comment 3 Nikolaus Rath CLA 2010-10-22 10:36:13 EDT
Created attachment 181500 [details]
screenshot
Comment 4 Nikolaus Rath CLA 2010-10-22 10:36:25 EDT
Created attachment 181501 [details]
screenshot 2
Comment 5 Andrew Gvozdev CLA 2010-10-22 10:41:43 EDT
The decorator on the project shows it as Python project. Is it a project with mixed natures? What do you have in .project in <natures> section?
Comment 6 Nikolaus Rath CLA 2010-10-22 13:43:25 EDT
The project contains both C and Python components. I created it as a PyDev project and then selected "Convert to C/C++" project in the context menu (which seemed to make it both a PyDev and CDT project). 

From .project:

	<natures>
		<nature>org.python.pydev.pythonNature</nature>
		<nature>org.eclipse.cdt.core.cnature</nature>
		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
	</natures>
Comment 7 Doug Schaefer CLA 2010-10-22 13:49:19 EDT
I've seen this too a couple of days ago (and meant to raise a bug). It appears that the C++ Build property doesn't show unless you are in the C/C++ Perspective. I regularly mix Java and C++ and you see this behavior in the Java perspective.
Comment 8 Andrew Gvozdev CLA 2010-10-22 14:16:48 EDT
I created PyDev project and converted it to Makefile CDT project. I got the same set of natures as described in comment 6. Still I see "C/C++ Build" property page in C/C++, Java, Pydev perspectives in all Project Explorer, Package Explorer and Pydev Package Explorer.
Your screenshot shows Pydev Package Explorer. If you open Project Explorer view, is it any different there or is it linked to perspective as Doug suggested?
Comment 9 Doug Schaefer CLA 2010-10-22 14:24:55 EDT
That could be it, I'm opening the properties from the Java Packages view. That would imply that the C++ Build property is dependent upon an ICProject.

The other thing I saw is that the C++ General property does always show up. So my question now is, how do these things differ? It would be a place to start looking.
Comment 10 Nikolaus Rath CLA 2010-10-22 15:48:40 EDT
The problem is not related to the perspective. It occurs in both the PyDev view with the PyDev Package Explorer and in the C/C++ View with the Project Explorer.
Comment 11 Andrew Gvozdev CLA 2010-10-22 15:52:53 EDT
Do you have anything suspicious in .log?
Comment 12 Nikolaus Rath CLA 2010-10-22 16:17:25 EDT
Which .log do you mean?
Comment 13 Andrew Gvozdev CLA 2010-10-22 16:28:45 EDT
There is a log file in your-workspace/.metadata/.log. You can also see its contents in eclipse view General/Error Log.
Comment 14 Nikolaus Rath CLA 2010-10-23 10:22:03 EDT
Created attachment 181579 [details]
.metadata/.log

here is the log file.
Comment 15 Anton Leherbauer CLA 2010-10-29 06:49:39 EDT
Created attachment 182028 [details]
Fix enablement expressions

This patch should fix it.  At least it works for JDT.
JDT and probably also PyDev have their own element types (JavaProject, etc.).  The solution is to enable the page for any type that adapts to IProject (or IResource - depending on the page) and has the required nature.
Additionally AbstractPage also needs to support adaptable types otherwise it throws a NullPointerException.
Comment 16 Anton Leherbauer CLA 2010-10-29 08:28:27 EDT
I committed the changes to HEAD and cdt_7_0.