Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cumbersome and difficult to add existing source files to project
Cumbersome and difficult to add existing source files to project [message #736656] Fri, 14 October 2011 07:40 Go to next message
blaauw.deon is currently offline blaauw.deonFriend
Messages: 3
Registered: October 2011
Junior Member
Hi Guys

I am really finding that trying to add existing c files to my project is extremely cumbersome - I'm almost 100% sure that I am doing something wrong and hope you could help me!

I have an existing C project in eclipse that lives in the workspace. Only my main.c file is in the actual workspace, and I want to include c files checked out using tortoise svn ( I am running windows 7 ) from various locations on my hard drive.

What I typically do to accomplish this:
1. Right Click on the Project
2. Select New -> Folder
3. Select Advanced, 'Link to alternate location)
4. Browse to the folder I want to include
5. Select Finish

The folder is now in my workspace. This is very cumbersome if you have multiple folders you wish to add - and especially if you copy the workspace to a different PC and all the paths need updating. The second step is to set-up the include directories for the compiler so it actually knows where the files are. My eclipse auto-detects a MINGW GCC installation somewhere on my machine. These steps does it:

1. Right click on the project, select 'Properties'
2. Select C/C++ General -> Paths and Symbols
3. Click GNU C on the Includes Tab under languages
4. Click Add - > Workspace
5. Select the folder you just added

Finally I can compile. I do not wish to have my c files in my workspace, so using eclipse to checkout from svn into the workspace is not what I want to do (also against project policy for some reason). Saying that, importing and making a copy of the files in the workspace is also out of the question.

Is there a simpler way to do all of this? Basically I need to be able to set-up a relative path to my c files, and have eclipse update all necessary paths such that the active compiler is aware of the source location.


Any help is much appreciated!
Re: Cumbersome and difficult to add existing source files to project [message #736937 is a reply to message #736656] Fri, 14 October 2011 13:39 Go to previous message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
This was answered in your original post. Look there.
Previous Topic:Some Eclipse / CDT questions
Next Topic:Getting attribute values from the CDT Debugger programmatically
Goto Forum:
  


Current Time: Thu Apr 25 17:18:50 GMT 2024

Powered by FUDForum. Page generated in 0.03153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top