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

Bug 345426

Summary: relative include path becomes absolute, and libraries are removed
Product: [Tools] CDT Reporter: Erik <erik>
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: benjamin.mueller, cdtdoug, erik, yevshif
Version: 7.0.2   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 275779    

Description Erik CLA 2011-05-11 10:07:09 EDT
Build Identifier: 20110218-0911

when removing a linked folder that is added to the source location from the project. relative path become absolute paths and library paths are removed.

Reproducible: Always

Steps to Reproduce:
1.	Create an Eclipse C++ project (for example a “Hello world” project)
2.	Edit project settings
 a.	Right-click on project, select Properties (Project Properties dialog)
 b.	Goto C/C++ General >> Paths and Symbols
 c.	In the Includes tab, set a relative include parh for GNU C++ (“${ProjDirPath}/bla”).
 d.	In the Libraries tab, add a library (“bla”)
 e.	In the Library Paths tab, add a path (“/opt/bla”)
 f.	Confirm with the OK button
3.	Add a “Linked Folder”:
 a.	Right-click on project, select New >> Folder (“New Folder” dialog)
 b.	Click on “Advanced”
 c.	Select “Link to alternate location (Linked Folder)”
 d.	Brows to a Folder
 e.	Click “Finish”
4.	Add the Linked Folder to the Source Folder:
 a.	Right-click on project, select Properties (Project Properties dialog)
 b.	Goto C/C++ General >> Paths and Symbols
 c.	In the Source Location tab, Click “Add Folder...” (Folder Selection dialog)
 d.	Add the Linked Folder
 e.	Close the dialog with the OK button
5.	In the Project Explorer, select the Linked Folder and remove it from the project (select the folder and hit delete)
6.	Click ok on the Warning Dialog
7.	Go again to Project Settings Properties and notice:
 a.	The relatieve include-path has become absoluut
 b.	The include-path is also added to "Assembly Source Files" and "GNU C"
 c.	The Libraries tab is empty
 d.	The Library Paths tab is empty
Comment 1 Benjamin Müller CLA 2011-07-25 09:38:21 EDT
Another way to reproduce the relative path issue is:

1.    Create an Eclipse C++ project (for example a “Hello world” project)
2.    Edit project settings
 a.    Add a relative include path (e.g. -> ../h or "${ProjDirPath}/h")
 b.    Confirm with "ok"
3.    Build the project
4.    Add a new source folder
5.    Add a new dummy c modul in this source folder
6.    Build the project
7.    Delete the new created source folder
8.    Build the project
9.    Access the project properties
--> all Include-Paths are absolute 

If I will use the relative path in the workspace relative way ("${workspace_loc:/${ProjName}/h}") I will get another strange behavior:

1.    Create an Eclipse C++ project (for example a “Hello world” project)
2.    Edit project settings
 a.    Add a relative include path "${workspace_loc:/${ProjName}/h}
 b.    Confirm with "ok"
3.    Build the project
4.    Add a new source folder
5.    Add a new dummy c modul in this source folder
6.    Build the project
7.    Delete the new created source folder
8.    Build the project
9.    Access the project properties
--> The variable ${ProjName} is replaced twice --> ${workspace_loc:/<project_name>/<project_name>a/h}