How to use Eclipse and CDT to edit C source files
I am using Tornado 2.2 to develop C code for VxWorks. The editor in Tornado isn't the greatest, so I want to edit my code in Eclipse with the CDT plugin. I will still be using Tornado to build the projects, so instead of using a Standard or Managed Make Project, I just created a folder which linked to my source files. Note that you may get messages in Tornado that say "This file has been changed outside the source editor. Do you want to reload it?" Just make sure you don't have any unsaved changes from Tornado and click "Yes". Or just make sure all your source code windows are closed in Tornado. I know this isn't the most elegant solution, but it will have to do unless we upgrade to VxWorks 6 and Workbench.
Update 2/13/07: I've found a better way to use Eclipse with Tornado projects. See my post How to use Tornado GNU tools with Eclipse/CDT for how to use Eclipse to edit *and build* your Tornado project.
Here are the steps:
- Start with your .c and .h files in a directory called "c:\sofeng\proj\stuff"
- Download and install eclipse-SDK-3.2.1-win32.zip from http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2.1-200609210945/eclipse-SDK-3.2.1-win32.zip
- Download and install org.eclipse.cdt-3.1.1-win32.x86.zip from http://download.eclipse.org/tools/cdt/releases/callisto/dist/3.1.1/
- Run "eclipse.exe"
5. From the menu: "Window" -> "Open Perspective" -> "Other..." -> "C/C++" -> "OK" - From the menu: "File" -> "New" -> "Other..."
- Under "General", select "Project"
- Click "Next"
- In the "Project name:" field, type "dummy". Leave the "Use default location" box checked.
- Click "Finish"
- From the menu: "File" -> "New" -> "Folder"
- In the "Enter or select the parent folder:" enter or select the "dummy" project you just created.
- Click the ">> Advanced" button
- Click the "Link to folder in the file system" checkbox and enter "c:\sofeng\proj\stuff" or "Browse..." to that location.
- Click "Finish"
- From the "Window" menu, select "Preferences..."
- Go to "General" > "Workspace" > "Linked Resources" and check "Enable linked resources"
- Click "OK"
Comments
This method seems to work but quite a few options don't such as syntax highlighting and outline view.