blob: 01618ef460a66cc7111330671e07a5a14e06cf68 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>How to bring C/C++ source files into Eclipse</title>
<link rel="stylesheet" type="text/css" href="../help.css">
</head>
<body>
<h1>How to bring C/C++ source files into Eclipse</h1>
<p>A common scenario that you may encounter when starting to use the CDT, is
determining how
to bring existing C/C++ source files into Eclipse. There are a number of ways to
do this. The scenarios described below are recommended approaches.</p>
<h2>Create new projects for existing source roots</h2>
<p>If you can access the source from your desktop using the command
line, then you can make the root source folders Eclipse projects. This is accomplished by
creating a C/C++ Standard Make Project. For more information, see
<a href="../tasks/cdt_t_proj_new.htm">Creating a project</a> and
<a href="../tasks/cdt_o_proj_prop.htm">Defining project properties</a>.</p>
<p>The resources for the project are maintained in the remote location specified,
not in the workspace folder for Eclipse. However, your existing folder structure
is displayed in the C/C++ Projects view. Meta data for the project, such as the
index for the project and the link to the existing source, is stored in the metadata
directory in the workspace folder. For more information on the workspace folder,
see <b>Workbench User Guide &gt; Tasks &gt; Importing &gt; Upgrading Eclipse</b>.</p>
<h2>Create a project from CVS</h2>
<p>If your existing source tree is managed in CVS, you can use the CVS
Repository perspective to &quot;Checkout As...&quot; any folder in the repository.
The first time you &quot;Checkout As...&quot;, the New Project wizard is launched and you need to
create a C or C++ project for the folder. For more information, see
<a href="../tasks/cdt_t_proj_new.htm">Creating a project</a> and
<a href="../tasks/cdt_o_proj_prop.htm">Defining project properties</a>.</p>
<p>A CVS checkout of the project into the project's location occurs.</p>
<h2>Import your C/C++ source file system</h2>
<p>Another approach would be to create a C/C++ Project and then import your
existing file system.
For more information, see <b>Workbench User Guide &gt; Tasks &gt; Importing &gt;
Importing resources from the file system</b>.</p>
<p>This approach&nbsp;copies the files from your file system to an Eclipse Workbench
project or folder. Your original source files remain unchanged and it is the
copies of the files that will be edited, built and debugged using the CDT.&nbsp;
When you have successfully imported your existing file system, the folder
structure is displayed in the C/C++ Projects view.</p>
<p><b>Tip:</b></p>
<ul>
<li>Importing your existing file system can consume significant disk space
depending on the size of your files.</li>
<li>Your files may become detached from an existing source control system that
previously referenced the original file location such as a ClearCase view.</li>
</ul>
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
<br>
<a href="../concepts/cdt_c_over_cdt.htm">Overview of the CDT</a><br>
&nbsp;<a href="../concepts/cdt_c_projects.htm">CDT Projects</a></p>
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
<br>
<a href="../tasks/cdt_o_proj_files.htm">Working with C/C++ project files</a></p>
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
<br>
<a href="../reference/cdt_o_proj_prop_pages.htm">Project properties</a></p><p>
<img src="../images/ng03_04.gif" ALT="IBM Copyright Statement" BORDER=0 width="324" height="14">
</body>
</html>