This will let you select the outer Marlin folder that you already have set up as location of the code, and designate it for C and C++ code:
Once the file is imported, there are just a few things you need to do, to help Eclipse find its way around the files so that it can analyze and build it properly. Firstly, Eclipse needs to know the path to the inner Marlin directory, where it can find the Makefile. To do this, right click on the Project in the Project Explorer, and select 'Properties'. Then drill down to the 'C/C++ Build' settings, and point the Build location at the inner Marlin directory:
Setting this up will allow you to use the build and 'make clean' functionality in Eclipse (running 'Project -> Clean...' is a good way to refresh the workspace view, and clean out any old error messages that might be lingering in the Eclipse Problem view).
Next, you need to give Eclipse some pointers to the structure of the project, so it can find the necessary headers during it's internal build processes. These are added in the 'Paths and Symbols' tab of the 'C/C++ General' preferences. There are four folders of header files that Eclipse needs to know about:
These settings need to be set up for C and C++ languages, and point at the avr/avr/include, arduino/cores/arduino, libraries/SPI and libraries/LiquidCrystal folders that are part of the Arduino toolset. The paths above, are for the standard Mac OS install of the Arduino tools, but you will need to adjust them for other platforms.
Finally, you need to also define the appropriate architecture type for your printer hardware. This is normally done in the set up for the arduino tools, and so is taken care of when building using make, but Eclipse doesn't know about it, and so needs to be told, so that all the appropriate pin definitions etc are in place. For the current Ultimaker electronics, the appropriate value that needs defining is __AVR_ATmega2560__.
As a starting point, this XML Eclipse_Imports_and_Symbols definition file can be imported directly into Eclipse from that Paths and Symbols page:
Once these are set up, Eclipse should be able to understand and analyze the Marlin code, without complaining about code problems that don't show up when actually building the code with make.
You can still build from the command line using make, as discussed in my earlier post, or you can now also use the 'Project -> Build All' command in Eclipse.