[Setup] FLTK - A simple C++ GUI Library

1. Install Windows SDK (v6.0A);

2. Install Visual Studio (v2008 professional);

3. Download latest stable release of FLTK from http://www.fltk.org/index.php (v1.1.9);

4. Extract the fltk to C:/FLTK folder;

5. Open C:/FLTK/vs2005/fltk.sln; As I use VS2008 to open vs2005 solution file, it will promote an upgrade dialogue. Just follow it to upgrade.

6. After that, Add a new environment variable to the system:

FLTKDIR - C:/FLTK

7. Go to Tools > Options > Projects and Solutions > VC++ Directories and under "Show directories for:" select "Include files". Select the top directory listed and click the folder icon to insert a new line  at the top; enter C:/FLTK. Now select "Library files", select the top directory listed and click the folder icon to insert a new line at the top; enter C:/FLTK/lib.

The Manual I referenced is:

FLTK for Microsoft Visual C++ Express Edition on Windows XP

10/17/2007

0. First install the latest version of Windows Installer by going to

http://www.microsoft.com/downloads/details.aspx?familyid=889482FC-5F56-4A38-B838-DE776FD4138C&displaylang=en and clicking Continue, and so on. Then install the update at http://www.microsoft.com/downloads/details.aspx?FamilyID=7a81b0cd-a0b9-497e-8a89-404327772e5a&DisplayLang=en.

1. Then install Microsoft Visual C++ Express Edition from http://msdn2.microsoft.com/en-us/express/aa975050.aspx, steps 1-4. (Note: Do not click Visual Studio 2008.) You should not have to uninstall other

Visual Studios, SQLs, etc. first unless installing VC++ Express fails. In

that case, go to http://msdn2.microsoft.com/en-us/vstudio/aa718405.aspx for instructions on uninstalling conflicting versions of SQL, Visual Studio, or

.NET and then try the install again.

2. Next install the Platform SDK--go to www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en and at the bottom of the page click PSDK-x86.exe to download; run this file. Now do the following substeps:

Substep 2.3: Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box.

Add these paths to the appropriate subsection. (To add a directory select the top directory listed and click the folder icon to insert a new line at the top; type the specified path and press Enter.)

  • Executable files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Bin
  • Include files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include
  • Library files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Lib

Note: Alternatively, you can update the Visual C++ Directories by modifying the VCProjectEngine.dll.Express.config file located in the /vc/vcpackages subdirectory of the Visual C++ Express install location. Please make sure that you also delete the file "vccomponents.dat" located in the "%USERPROFILE%/Local Settings/Application Data/Microsoft/VCExpress/8.0" if it exists before restarting Visual C++ Express Edition.

Substep 2.4: Update the corewin_express.vsprops file.

One more step is needed to make the Win32 template work in Visual C++ Express. You need to edit the corewin_express.vsprops file (found in C:/Program Files/Microsoft Visual Studio 8/VC/VCProjectDefaults) and

Change the string that reads:

AdditionalDependencies="kernel32.lib"

  to

AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"

Substep 2.5: Generate and build a Win32 application to test your paths.

In Visual C++ Express, the Win32 Windows Application type is disabled in the Win32 Application Wizard. To enable that type, you need to edit the file AppSettings.htm file located in the folder “%ProgramFiles%/Microsoft Visual Studio 8/VC/VCWizards/AppWiz/Generic/Application/html/1033/".

In a text editor comment out lines 441 - 444 by putting a // in front of them as shown here:

// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true;

Save and close the file and open Visual C++ Express.

From the File menu, click New Project. In the New Project dialog box, expand the Visual C++ node in the Product Types tree and then click Win32. Click on the Win32 Console Application template and then give your project a name and click OK. In the Win32 Application Wizard dialog box, make sure that Windows application is selected as the Application type and the ATL is not selected. Click the Finish button to generate the project.

As a final step, test your project by clicking the Start button in the IDE or by pressing F5. Your Win32 application should build and run.

3. Run Windows Update and install .NET Framework 2.0 if it is listed,

plus any other updates your computer needs; reboot. Run Windows Update

and install any other updates your computer needs; reboot; repeat as

needed. Follow the instructions in Appendix G2 to enter a HelloWorld.cpp

program and make sure it runs. Then copy http://courses.cs.tamu.edu/daugher/cpsc121/06fall/std_lib_facilities.h as directed in Appendix G2, add the line

#include "../../std_lib_facilities.h"

to your program, and rebuild the solution to make sure it still runs.

4. Go to http://fltk.org and download the latest stable release,

currently fltk-1.1.7-source.zip. Create a new folder C:/FLTK and unzip

the downloaded archive to C:/FLTK.

5. Locate C:/FLTK/fltk-1.1.7/vc2005/fltk.sln and double-click on it.

This will open VC++ Express.

6. Go to Tools > Options > Projects and Solutions > VC++ Directories

and under "Show directories for:" select "Include files". Select the

top directory listed and click the folder icon to insert a new line

at the top; enter C:/FLTK/fltk-1.1.7. Now select "Library files",

select the top directory listed and click the folder icon to insert a

new line at the top; enter C:/FLTK/fltk-1.1.7/lib.

7. Build the solution (F7) and start it (CONTROL-F5). If you are

successful, CubeViewd should execute. Now reward yourself and play

with the sliders and rollers (move, rotate, pan, zoom, etc.) for a

while--you deserve it! :-)

8. Open each of the following files from the Code section of the

course web page, one at a time, and click File > Save As to save each

file to C:/Documents and Settings/ /My Documents/

Visual Studio 2005/Projects (where you put std_lib_facilities.h in

step 3):

fltk.h

Graph.h

Graph.cpp

GUI.cpp

GUI.h

Point.h

Simple_window.h

Window.h

Window.cpp

Be sure to save as text files, not HTML or anything else.

9. Create a new project named sample_main3 (not sample_main) and add

a new item sample_main3.cpp (not sample_main.cpp) from the Code

section of the course web page. Add existing items Graph.cpp,

GUI.cpp, and Window.cpp from the directory in step 8. Right-click on

the project name and select Properties. Locate Configuration

Properties > Linker > Input > Additional Dependencies and add the

following:

fltkd.lib

fltkjpegd.lib

fltkimagesd.lib

wsock32.lib

comctl32.lib (that's a lower-case "L" before the "32")

Under Ignore Specific Library, add libcd.lib. Locate Configuration

Properties > C/C++ > General > Additional Include Directories and add

C:/FLTK. Build the solution (F7) and start it (CONTROL-F5). If you

are successful, you should get a new window titled "two lines" with

two lines on it like axes or a big plus sign, plus a button labelled

"Next" which closes the window. Major congratulations!

From this point on, create your FLTK programs the same way as

sample_main3.cpp. Better yet, make incremental changes to

sample_main3.cpp to transform it into the desired homework program.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值