Community
Participate
Working Groups
Steps to reproduce: 1. Create a C/C++ project (New -> C(C++) Project -> Executable -> Hello World ANSI C Project) 2. Cross GCC toolchain 3. Set the correct Path to gcc Project is created. Problems view contains: Description Resource Path Location Type Program "gcc" not found in PATH test2 Project Properties, C++ Preprocessor Include.../Providers, [CDT Cross GCC Built-in Compiler Settings] options C/C++ Scanner Discovery Problem Description Resource Path Location Type Program "g++" not found in PATH test2 Project Properties, C++ Preprocessor Include.../Providers, [CDT Cross GCC Built-in Compiler Settings] options C/C++ Scanner Discovery Problem Do any changes in PATH variable of the project -> Apply - > OK Indexer works again -> errors disappear
I think I can reproduce this. Which of the new project wizard did you use exactly? It looks like the new C/C++ Project wizard broke this. So in summary: - New C Project: works - New C++ Project: works - New C/C++ Project: doesn't work
Doug, is it possible that the new wizard does not use operationClass attribute properly? In the case of Cross GCC, I'm talking about: <extension point="org.eclipse.cdt.managedbuilder.ui.newWizardPages"> <wizardPage ID="org.eclipse.cdt.build.crossgcc.setcCrossCommandWizardPage" this one -> operationClass="org.eclipse.cdt.internal.build.crossgcc.SetCrossCommandOperation" pageClass="org.eclipse.cdt.internal.build.crossgcc.SetCrossCommandWizardPage"> <toolchain MBSCustomPageManager.java: /** * attribute for the operation that is run for a wizardPage during the wizard's DoRunEpilogue() method */ public static final String OPERATION_CLASS = "operationClass"; //$NON-NLS-1$
*** Bug 502869 has been marked as a duplicate of this bug. ***
The GNU ARM Eclipse plug-ins are also affected, the new wizard does not initialise properly the created projects and builds are simply not possible. The wizard uses "org.eclipse.cdt.managedbuilder.ui.newWizardPages" with custom operationClass and pageClass. Both are mandatory for the correctness of the created project. The functionality of the pageClass seems ok, since I can see the extra page asking for the toolchain name/path. Could you check if the operationClass is properly used?
the problem is actually trickier, and is caused by a change in the logic to invoke, or, for the new wizard, **not** to invoke the SetCrossCommandWizardPage, custom to the Cross wizard (and similarly in the GNU ARM Eclipse wizard). if the user navigates through all pages, including the Cross GCC Command page, the project is generated correctly with both wizards. if the user clicks the Finish button earlier, with the new wizard there is an internal exception and the project is not generated completely. in more detail: - the SetCrossCommandOperation.run() method starts by getting the projectName from the SetCrossCommandWizardPage via: String projectName = (String) MBSCustomPageManager.getPageProperty(SetCrossCommandWizardPage.PAGE_ID, SetCrossCommandWizardPage.CROSS_PROJECT_NAME); when used by the old wizard, this property is correctly set; when used by the new wizard, this property is null. a few lines down the road, the projectName is used to get the project object: IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); the getProject() method throws an AssertionFailedException, which prematurely terminates the project creation. - the CROSS_PROJECT_NAME property is set in SetCrossCommandWizardPage.isCustomPageComplete(); for the old wizard, this method is called early when the wizard is created: SetCrossCommandWizardPage.isCustomPageComplete() line: 83 SetCrossCommandWizardPage(MBSCustomPage).isPageComplete() line: 126 MBSWizardHandler.canFinish() line: 880 CCProjectWizard(CDTCommonProjectWizard).canFinish() line: 359 WizardDialog.updateButtons() line: 1300 WizardDialog.update() line: 1291 WizardDialog.showStartingPage() line: 1244 WizardDialog.createContents(Composite) line: 590 WizardDialog(Window).create() line: 426 WizardDialog(Dialog).create() line: 1095 for the new wizard, this method is no longer called during wizard creation, but only if the Cross GCC Command page is entered explicitly; finishing the wizard without entering the Cross GCC Command page leaves this property not initialised. the solution would be to update the new wizard and ensure that the custom wizard page is created and the isCustomPageComplete() called before getting the property. unfortunately I could not identify the place where to do this, and help from a more knowledgable committer is badly needed.
the cause of this bug is described in bug 512550, which is even worse.