Course list http://www.c-jump.com/bcc/

Lab 1: FLTK Library and Visual Studio C++ Project Configuration


  1. Fast Light Toolkit Library
  2. Downloading and Getting Started with FLTK
  3. Building FLTK library
  4. Lab Directory Configuration
  5. Download and build FLTK
  6. Copy FLTK files
  7. Hello, GUI!
  8. C++ headers and LIB files
  9. Optional: Visual Studio Project Configuration
  10. How to submit

1. Fast Light Toolkit Library



2. Downloading and Getting Started with FLTK


  1. Download the source of the latest stable release version (e.g. fltk-N.N.N-source.tar.gz) from FLTK library website. FLTK is cross-platform tool that works with Microsoft Visual Studio on Windows, as well as Linux and MAC OS.

  2. Unzip the downloaded file. The process takes two steps: first, it unzips into a .tar file. Next, unzip the .tar file, which creates a subdirectory named fltk-N.N.N.

     


3. Building FLTK library


  1. Navigate to fltk-N.N.N\ide\VisualC2010

  2. Double-click the file named fltk.sln. This will open a large solution that includes the source code for the FLTK demo apps and FLTK library itself. Be patient, it may take almost up to a minute for all parts to load into Visual Studio development environment.

  3. Since FLTK is open source software, once downloaded, it needs to be built on your computer. Click Visual Studio menu

    
        Build -> Configuration Manager...
    
    

    and switch active configuration to Release.

  4. Click Visual Studio menu

    
        Build -> Rebuild Solution
    
    

    Be patient as the surce code is being compiled. It will take several minutes to finish. If everything is okay, you should see a message similar to

        ========== Rebuild All: 79 succeeded, 0 failed, 0 skipped ==========
    

    at the end.

  5. Click Visual Studio menu

    
        Build -> Configuration Manager...
    
    

    and switch active configuration to Debug.

  6. Click Visual Studio menu

    
        Build -> Rebuild Solution
    
    
  7. Exit Visual Studio.

     


4. Lab Directory Configuration



5. Download and build FLTK


  1. Go to fltk.org and click Download link.

  2. Download the latest fltk-N.N.N-N-source.tar.gz file.

  3. Unzip downloaded content. For example,

    
        C:\Users\myself\Downloads\fltk-N.N.N-N
    
    
  4. Open ide, then VisualC2010 subdirectory:

    
        C:\Users\myself\Downloads\fltk-N.N.N-N\ide\VisualC2010
    
    
  5. Scroll down and locate file named fltk.sln

  6. Start Visual Studio and click File, Open, Project/Solution...

  7. Open fltk.sln solution file.

  8. Click OK to upgrade VC++ compiler and libraries.

  9. Check that everything is completed, 0 failed, 0 skipped.

  10. Click Build, then Build Solution. Wait till the build is complete. This may take a few minutes. Verify that build succeeded, 0 failed, 0 up-to-date, and 0 skipped.

  11. Click Build, then Configuration Manager... Change "Active solution configuration" to Release and click Close.

  12. Again, click Build, then Build Solution. Wait till the build is complete. This may take a few minutes. Verify that build succeeded, 0 failed, 0 up-to-date, and 0 skipped.

  13. Exit Visual Studio.

     


6. Copy FLTK files



7. Hello, GUI!



8. C++ headers and LIB files



9. Optional: Visual Studio Project Configuration


  1. Use menu

    
        File -> New -> Project
    
    
  2. Make sure to select C++ language and "Win32 Project"

  3. Specify project name

  4. Specify directory location of your project, such as

    
        C:\bcc\c255labs\playground
    
    
  5. Uncheck "Create directory for solution"

  6. Once project is created, select

    
        View -> Solution Explorer
    
    
  7. Right-click "Source Files", then

    
        Add -> New Item...
    
    

    and select CPP file type. Name it main.cpp. Copy and paste the code from this lab.

  8. Right-click the name of your project in the Solution Explorer. Select Properties.

  9. Switch to Debug configuration.

    fltkd.lib
    fltkformsd.lib
    fltkgld.lib
    fltkimagesd.lib
    fltkjpegd.lib
    fltkpngd.lib
    fltkzlibd.lib
    
  10. Switch to Release configuration.

    fltk.lib
    fltkforms.lib
    fltkgl.lib
    fltkimages.lib
    fltkjpeg.lib
    fltkpng.lib
    fltkzlib.lib
    
  11. Make sure to test your program for both Debug and Release builds.

     


10. How to submit