Using FLTK at Home
CS 559 – Introduction to Computer Graphics
September 12, 2000
1) Download the FLTK source code .zip file to your hard drive. It can be found at www.fltk.org
2) Extract the source files from the .zip file to a directory on your hard drive.
3) Open up Visual C++ 6.0.
4) Choose File->Open Workspace. Open up fltk-1.0.9\visualc\fltk.dsw
5) Choose Build->Set Active Configuration. Select CubeView – Win32 Release.
6) Compile the project by choosing Build->Build CubeView.exe or by pressing F7.
7) Choose Build->Set Active Configuration. Select CubeView – Win32 Debug.
8) Compile the project by choosing Build->Build CubeView.exe or by pressing F7.
Follow the online tutorial ( www.cs.wisc.edu/~cs559-1/Notes/fltktut.html )exactly, except make a few substitutions in section 3.
I’m assuming that you placed FLTK in your C: drive. Make changes as necessary.
Now the new project is created, we are going to configure it to be a FLTK project.
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:", type in: c:\fltk-1.0.9\
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, type in: c:\fltk\lib
This allows the linker to find FLTK library binary files.
The following steps will set the project, so that correct output format is used when generating object files.
1.Click "C/C++" tab again
2.Choose "Code Generation" in the "Category" menu
3.Select "Win32 Release" item, in the "Settings For:" menu
4.Change "Use run-time library" option to "Multithreaded" by selecting it from the menu.
5.Select "Win32 Debug" item, in the "Settings For:" menu
6.Change "Use run-time library" option to "Debug Multithreaded" by selecting it from the menu.
Then we need to tell the linker to use the essential libraries when creating the executable file. Notice that we must change the settings for both "Debug" and "Release" versions. For debug, we need to specify the debug version of the fltk library. Also, notice that we are adding the 2 libraries to our program, so we must be careful not to remove any others.
1.Click "Link" tab
2.Select "Win32 Release" item, in the "Setting For:" menu
3.Add WITHOUT replacing anything else in the "Object/library modules:" field the
following text: fltk.lib wsock32.lib
4.Select "Win32 Debug" item, in the "Setting For:" menu
5.Add WITHOUT replacing anything else in the "Object/library modules:" field the
following text: fltkd.lib wsock32.lib
6.Then click "Ok".