These are the instructions for how to set up FLTK in MSVC. There are slight
differences between .NET and MSVC6, so watch out!

  1. First, you need to download the latest version of FLTK from fltk.org
  2. After unzipping it, please compile it (both in debug and release modes
  3. Right click on “My Computer”
  4. Choose “Properties”
  5. Go to the “Advanced” tab and click “Environment Variables”
  6. Add an environment variable named FLTK_DIR defined as d:/path/to/fltk/folder
  7. Open your MSVC
  8. New Project
  9. Console Application (in .NET, Project type is “Visual C++ Projects” and the template is “Win32 Console Project this is the second Console Application choice)
  10. in .NET (only) there’s another step here. Click “Application Settings” on the next screen. Select “Empty Project” and make sure that “Add support for:” does not have anything checked.
  11. Choose the “empty” application version
  12. Copy and paste all of the fltkbasicgl files into the folder on your harddrive just created by MSVC
  13. Right click on the Source Files folder (in side bar) and choose “Add Files to project…”
  14. Add the .cpps to this folder!
  15. Repeat the above 2 steps with the “Header Files” folder
  16. Right click on the project (in side bar) and choose “Settings…” (in .NET this is called “Properties”)
  17. Make sure that this is set up for “All Configurations” (not just release or debug mode)
  18. In the C/C++ tab, find the area for “Include Path” (in .NET this is on the first screen named “Additional Include Directories”. In MSVC6, this is on the “Preprocessor” screen)
  19. Add $(FLTK_DIR)
  20. In the link (in .NET this is “Linker”) tab, find the area for “Additional Library Path” (in .NET this is on the first screen called “Additional Library Directories”. In MSVC6, this is in the “Input” section)
  21. Add $(FLTK_DIR)/lib
  22. Now switch Configuration to Debug. Go to C/C++ “Code Generation”. Change your thread linker from “single-threaded” to “Multithreaded Debug DLL”. Do the same in Release mode, but do “Multithreaded DLL”.
  23. Make sure that the following lines are in your main.cpp, toward the top (btw. remove the \” and replace them with just “)
#ifdef _DEBUG
#pragma comment(lib, \"fltkd.lib\")
#pragma comment(lib, \"fltkgld.lib\")
#else
#pragma comment(lib, \"fltk.lib\")
#pragma comment(lib, \"fltkgl.lib\")
#endif
#pragma comment(lib, \"wsock32.lib\")
#pragma comment(lib, \"comctl32.lib\")
#pragma comment(lib, \"OpenGL32.lib\")
#pragma comment(lib, \"GLu32.lib\")

At this point, compile your code. You should be able to run it. If you go to fltkbasicgl.h and remove the comment before #define DEBUGGL, you should see a yellow quadralateral on a black background. Otherwise, expect random noise.

Have fun!