Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT: Import source / header files into my new project, without duplicating them

Im sure there is a very simple solution for this.

I have a bunch of .cpp / .h files from a project, say in directory ~/files

On the other hand, I want to create a c++ project using eclipse to work on those files, so I put my workspace on ~/wherever. Then I create a c++ project: ~/wherever/project, and include the source files (located in /~files).

The problem i'm having is that files are now duplicated in ~/wherever/project, and I would like to avoid that, specially so I know which copy of the file to commit.

Is this possible? Im sure it is, but cant get it.

Thanks in advance.

like image 496
Tom Avatar asked Apr 12 '10 06:04

Tom


2 Answers

You could try:

  • creating the project directly above the ~/files (which is not very clean, given the location of the sources in your home dir)
  • using a linked folder
  • importing existing sources in your project: details all the options (when your sources are also managed by a VCS like CVS, or when your sources are not managed)
like image 191
VonC Avatar answered Sep 30 '22 21:09

VonC


Create a file or folder in your project as per normal (choose File->New->Folder), give it a name, and click on the Advanced button. This reveals a file-choose field where you can browse for the resource you want to "virtually" include in the project. Click Okay and the file/folder you named is now linked outside of the project.

like image 24
fabrizioM Avatar answered Sep 30 '22 21:09

fabrizioM