Adding The bcm2835 Library By Mike McCauley
Install the library on a RPi by following the instructions here.
Copy the bcm2835-#.# folder after compiling it onto your windows PC using a USB stick.
Copy the following files:
into the folder:
Add the library to eclipse
In eclipse, right click your project > Properties > C/C++ Build > Settings > Cygwin C++ Linker > Libraries. Add a new library entry: bcm2835
Copy file bcm2835.h into your project and include it in your source code files that use the IO.
Auto Save Before Build
Window > Preferences > General > Workspace. Check 'Save automatically before build'.
Compile Warnings Options
Right click project > Properties > C/C++ Build > Settings > Cygwin C++ Compiler > Warnings (also Cygwin C Compiler)
Adding files to project
Just copy them into the projects src folder and they will appear.
Otherwise for files located outside of the project
Right click the projects src folder > Import > General > File System
Turning Off Warnings
Window > Preferences > C/C++ > Code Analysis. Uncheck warnings you don't want.
Show Line Numbers
Eclipse show line numbers option is in: Menu > preference > general > editors > text editors > show line numbers.
Adding Object Files From Other Libraries
There can be issues with absolute paths when using Cygwin. They can be resolved by simply replacing all of the c:/ with /cygdrive/c and storing the files in C:\cygwin.