FLTK Installation and Project setup

Table of Contents

  1. Downloading FLTK
  2. Installing FLTK
  3. Using FLTK in linux.cs.tamu.edu
  4. Using FLTK in Visual Studio .NET
  5. Test if it worked

Downloading FLTK

  1. Go to http://fltk.org.
  2. Click Software in the navigation menu.
  3. Choose "FLTK 1.1.x" in the dropdown and click "Show Download Locations".
  4. Choose a download location and download the .zip file.

Installing FLTK

  1. Unzip the downloaded file and open the main folder, fltk-1.1.?. In the visualc folder, open fltk.dsw. If asked about updating old project files, choose "Yes to All".
  2. From the Build menu, choose "Build Solution". This may take a few minutes. The source code is being compiled into static link libraries so that you do not have to recompile the FLTK source code anytime you make a new project. When the process has finished, close Visual Studio.
  3. From the main FLTK directory open the lib folder. Copy all the .lib files except README.lib (there should be 4) into C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib
  4. Go back to the FLTK main directory and copy the FL folder into C:\Program Files\Microsoft Visual Studio .NET\Vc7\include

Using FLTK on linux.cs.tamu.edu

  1. If you are working on a windows xp PC in the lab
  2. Put your program files and the files you downloaded from the course website in the same folder
  3. Compile and link your program, suppose we want to compile sample_main3.cpp,
    g++ sample_main3.cpp Graph.cpp Window.cpp GUI.cpp -o sample_main3 -lfltk -lfltk_images
  4. Now you can execute your program

Using FLTK in Visual Studio .NET

  1. Create a new project in Visual Studio .NET with one change to the usual procedure: create a "Windows application" instead of a "Console application" when choosing your project type.
  2. In the solution explorer side-window, right click the project icon (not the solution icon) and choose Properties.
  3. In the Properties dialog box, in the left menu, click the "Linker" folder. This expands a submenu. In this submenu, click "Input". In the text field on the right, enter the following text:
    fltkd.lib wsock32.lib comctl32.lib fltkjpegd.lib fltkimagesd.lib
    In the Ignore Specific Library text field, enter the following text:
  4. In the left menu of the same Properties window, click "C/C++" to expand a different submenu. Click the "Code Generation" submenu item. In the right menu, change the "Runtime Library" dropdown to "Multi-threaded Debug DLL (/MDd)". Click "Ok" to close the Properties window.
  5. (For CPSC labs in HRBB only) Go to the Tools menu and select Options. Then go to Projects and Solutions -> VC++ Directories. Change the "Show directories for:" combo box to "Include Files". Add a new directory by clicking the New Line button (looks like a folder). Add "C:\fltk-1.1.7" to the list. Now change the "Show directories for:" combo box to "Library Files" and add "C:\fltk-1.1.7\lib" to the list. Click OK to save.

Testing if it all worked