Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I share source code among projects in Eclipse (CDT) without using absolute paths?

I know there are similar questions with answers, and some of them are being offered to my as I type this. However, none of them seem to offer a solution without absolute paths.

I have two projects in an SVN project, and they need use some .cpp and .h files in a shared way. I simply could not find a way of avoiding absolute paths, which are directly related to the directory I check out my code. It is very likely that everyone trying to use the code will have to modify these variables first.

I could not see any solution without using a variable (at best). Are there any recent tricks/developments I'm missing?

like image 682
mahonya Avatar asked Oct 08 '10 16:10

mahonya


1 Answers

I think I have solved it!. In Eclipse CDT 8, you can use linked files/folders with absolute or relative paths to Workspace.

You need to do this:

New folder->Advanced, mark "Link to file/folder into filesystem", Variables->Workspace->Extend, then select other project files/folders.

Finally use:

New source folder of each new linked folders.

That's all!

like image 99
logoff Avatar answered Nov 03 '22 01:11

logoff