University of Wisconsin Computer Sciences Header Map (repeated with 
textual links if page includes departmental footer) Useful Resources Research at UW-Madison CS Dept UW-Madison CS Undergraduate Program UW-Madison CS Graduate Program UW-Madison CS People Useful Information Current Seminars in the CS Department Search Our Site UW-Madison CS Computer Systems Laboratory UW-Madison Computer Sciences Department Home Page UW-Madison Home Page

CS559 Project Setup

Introduction

The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a LGPL'd C++ graphical user interface toolkit for X (UNIX®), OpenGL®, and Microsoft® Windows® NT 4.0, 95, 98, or 2000.

This document explains the Microsoft Visual C++ 6.0 project settings that are necessary to build GUI applications with FLTK. The reader is intended to load the CS559 project-type, and then step through all of the settings that are necessary to use the FLTK library. Note that this is neither detailed documentation on FLTK or MSVC++. For more information about FLTK, see the project website at

http://www.fltk.org/

Since this documentation is intended for the students in the Graphics class only, we assume that you are using the instructional Windows 2000 stations in the CSL labs.

Creating A New FLTK Work Space In Visual C ++ 6.0

  1. Open the Microsoft Visual C++ 6.0 application.
  2. Choose File->New...
  3. On top of the dialog box, click on the Projects Tab.
  4. Choose a name for your project and place it in the Project Name field.
  5. Choose a location for your project with the Location: field; be sure the location is somewhere on the U: drive if you wish to keep the project.
  6. Select the CS559 Project Maker AppWizard option. If this option is not available, you can choose Win32 Console Application and enter the settings given below.
  7. Select OK.
  8. You should now see a window listing the paths to the LibTarga and FLTK libraries and headers. The defaults should be correct, so just choose Finish.
  9. You will now see a window sumarizing the project that will be created. Everything should be fine so select OK.

This process should create a new directory with the name you choose, at your specified location, and will contain the project files.

Note: One big advantage of FlTk over some of the other UI toolkits is that it can be built into a console application. That means that all of the C++ standard I/O stuff you used under Unix (like printf or cout) can be used in your programs.

Walking Through the FLTK Project

Now that the project has been created, we will confirm that all the Visual Studio settings are correct. First, we'll check the include and library paths.

  1. Select Project->Settings...
  2. Choose All Configurations option in Settings For: menu.
  3. Click C/C++ tab, this should bring up the C/C++ compiler page up.
  4. Choose Preprocessor page from Category menu.
  5. In the field Additional include directories:, the path
    s:\fltk\include
    should be present. This tells the compiler where the header files for the library are.
  6. Click Link tab, this should bring up the linker page.
  7. Under Category menu, select Input.
  8. In the Additional library path: field, you should see the path:
    s:\fltk\lib
    This allows the linker to find FLTK library binary files.

Next, we'll step through the output format settings which will be used when generating object files.

  1. Click C/C++ tab again.
  2. Choose Code Generation in the Category menu.
  3. Select the Win32 Release item, in the Settings For: menu.
  4. Verify that the Use run-time library option is set to Multithreaded DLL.
  5. Select Win32 Debug item, in the Settings For: menu.
  6. Verify that the Use run-time library option is set to Debug Multithreaded DLL.

Finally, we'll verify that the linker knows where to find the essential libraries it needs to create an executable file. Notice that there are settings for both the "Debug" and "Release" versions. For debug, the debug version of the FLTK library is also specified.

  1. Click Link tab.
  2. Select Win32 Release item, in the Setting For: menu.
  3. Verify that the Object/library modules: includes the following two extries:
    fltk.lib     wsock32.lib
  4. Select Win32 Debug item, in the Setting For: menu.
  5. Verify that the Object/library modules: includes the following two entries:
    fltkd.lib     wsock32.lib
  6. Then click Ok.
Project setup is complete. You are now ready to add some source code to your FLTK project.

Last modified:  16:45 Sep 1, 2002