I have a blog posting that shows you how.
It was done in VS2003 but the same instructions on there have been seen to work equally as well in VS2010.
After installing, unzipping and building the fltk download, you should make sure that the following things are taken care of in your project properties:
- Add the required additional include directories.
- In the Project Properties -> Linker -> Input -> Additional Dependencies, ensure the {fltkd, wsock32, comctl32}.lib libraries have been included.
- In the Project Properties -> Linker -> General -> Additional Library Directories, ensure the correct path for the fltk library files is given.
- In the Project Properties -> C/C++ -> Code Generation -> Runtime Library field, make sure the “Multi-threaded Debug DLL (/MDd)” field is chosen.
You should then be in a position to try a simple example such as the following "Hello World" sample:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int main(int argc, char **argv)
{
Fl_Window *window = new Fl_Window(300,180);
Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
box->box(FL_UP_BOX);
box->labelsize(36);
box->labelfont(FL_BOLD+FL_ITALIC);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->show(argc, argv);
return Fl::run();
}