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

原创 2009年01月16日 15:01:00

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.

VS2017下安装fltk库——C++程序设计原理与实践图形编程指南

VS2017下安装fltk库——C++程序设计原理与实践图形编程指南前言最近,我在学习《C++程序设计原理与实践》(原书第一版)遇到了安装图形库的问题,我花了两天时间,通过各种途径查找解决办法,终于成...
  • wyf12138
  • wyf12138
  • 2017年07月08日 11:11
  • 1344

FLTK编译安装方法

1. 下载最新版的FLTK源码包,这里我下的是fltk-1.3.x-r7769.tar.gz 文件(下载地址:http://www.fltk.org/software.php?VERSION=fltk...
  • u012086167
  • u012086167
  • 2014年04月11日 14:48
  • 1492

嵌入式GUI方案选择

最近有项目需要使用GUI,在网上找了下嵌入式GUI的方案,备份如下: 平台限制: Linux平台; ROW和RAW在128M范围内;没有GPU,只有framebuffer;GUI方案尽可...
  • u012288815
  • u012288815
  • 2016年07月12日 16:40
  • 2704

FLTK学习-8-鼠标事件处理

part16:处理鼠标事件第二部分           这个例子有点像绘图程序。当你按下鼠标并拖动时,一条线就会随着鼠标移动绘出来。当点击左键时会连接下一次的点击位置绘出一条线,当点击右键时就会绘出...
  • Chinamming
  • Chinamming
  • 2013年11月29日 23:35
  • 957

CMake编译安装FLTK-1.3.3的详细步骤

本安装方式适合的系统环境为:Ubuntu 12.04, 并且已经安装了CMake。下文是通过CCMake进行安装前的变量配置的。...
  • arackethis
  • arackethis
  • 2014年12月29日 18:09
  • 1370

fltk动态分配数据显示图像

fltk中在控件上显示图像可以使用生成静态数组的方式,用的时候直接加载显示即可,但是这种方式对于只是开始时显示以后就不用的图像,静态数组不能随后释放,特别是在图像比较大时会占用大量的内存。     ...
  • Chinamming
  • Chinamming
  • 2013年11月29日 23:35
  • 816

ubuntu下实现fltk1.3.2的中文界面

最近琢磨着做一个跨平台的有界面的软件,google过程中发现一个轻量级跨平台GUI库fltk,看文档发现入门及其简单,小小兴奋了一阵,俺马上就能写一次代码,但是可以横跨mac linux和window...
  • u013591757
  • u013591757
  • 2014年02月06日 12:55
  • 838

第一章 开始编写FLTK程序

写一个简单的fltk程序 所有的程序到必须包含头文件,另外还要包含该程序用到的类的头文件。List 1说明了如何用FLTK显示一个窗口,窗口中显示“Hello World!” Listing ...
  • Chinamming
  • Chinamming
  • 2013年11月29日 23:52
  • 1217

值得推荐的C/C++框架和库 (真的很强大)

值得学习的C语言开源项目 - 1. Webbench Webbench是一个在linux下使用的非常简单的网站压测工具。它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作...
  • Bingo_Tao
  • Bingo_Tao
  • 2016年01月07日 07:36
  • 2035

FLTK 例子扫雷

[0]起因 花了一个星期左右的时间学习了下FLTK图形库,拿扫雷游戏作为学习FLTK图形库的原因有二: 扫雷游戏算法很简单;之前写过一个Win32API的扫雷游戏。(自己回头去看看,感觉以前的...
  • xizmi
  • xizmi
  • 2014年03月02日 15:28
  • 646
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:[Setup] FLTK - A simple C++ GUI Library
举报原因:
原因补充:

(最多只允许输入30个字)