I have a blog post that shows you how.
This was done in VS2003, but similar instructions there were the same for VS2010.
After installing, unpacking and creating fltk download , you should make sure that the following things are taken into account in your project properties:
- Add the necessary additional include directories.
- In the project properties → linker → contribution → additional dependencies, make sure that the {fltkd, wsock32, comctl32} .lib libraries are included.
- In the Project → Linker → General → Additional Library Directories properties, make sure that the correct path to the fltk library files is specified.
- In the Project Properties field → C / C ++ → Code Generation → Runtime Library, make sure that the "Multi-threaded DLL (/ MDd) debugging" field is selected.
Then you can try a simple example, for example the following Hello World example:
#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(); }
source share