如何安装 VS2010 的 FLTK?

发布于 2024-09-30 09:06:02 字数 220 浏览 1 评论 0原文

我正在为学校做一个项目,必须包含某种形式的 GUI。遗憾的是,我对 GUI 没有任何经验,所以我只是花了最后几个小时比较各种工具包,并选择了 FLTK,因为它的轻量级。我还花时间尝试通过阅读各种指南来安装 FLTK,但没有成功。

我想知道是否有人可以告诉我一步一步该怎么做。提前致谢

顺便说一句,我正在使用 Visual Studio 2010 Professional 和 Windows 7

I'm doing a project for school have to incorporate a form of GUI. Sadly, I have no experience with GUIs whatsoever so I just spend the last few hours comparing the various toolkits and settled on FLTK for it's lightweightness. I also spent the time attempting to install FLTK by reading various guides but to no avail.

I was wondering if anyone could tell me what to do step-by-step. Thanks in advance

BTW I am using Visual Studio 2010 Professional with Windows 7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

向日葵 2024-10-07 09:06:02

首先,您应该从网站下载 fltk(可能是 .zip 或 .tar)。我已经下载了 fltk1.3.x...)

然后解压它,打开文件夹并查找扩展名为 .dsw 的文件。 (我的位于名为 ide 的文件夹中)。此文件将打开 Visual Studio 解决方案。

它可能会要求您将解决方案升级到 Visual Studio 的当前版本。对所有人说“是”。

项目打开后,单击构建/构建解决方案。需要一些时间来建造。

然后从 lib 文件夹将 .lib 文件(readme.lib 除外)复制到文件夹 ProgramFilesx86/MicrosoftVisualStudio10/VC/lib 中。

然后将 FL 文件夹复制到 ProgramFilesx86/MicrosoftVisualStudio10/VC/include 中。

安装结束...
有关更多详细信息,您可以阅读 Stroustrup 的编程原理和使用 C++ 的练习。

First you should download fltk from the website,( it may be .zip or .tar). I have downloaded fltk1.3.x...)

Then you extract it, open the folder and look for a file with extension .dsw. (mine was in a folder called ide). This file will open a Visual Studio Solution.

It will probably ask you to upgrade the solution to the current version of Visual Studio. Say yes to all.

When the project opens, click build/build solution. It takes some time to be built.

Then from the lib folder copy the .lib files (except readme.lib) to the folder ProgramFilesx86/MicrosoftVisualStudio10/VC/lib.

Then copy FL folder into the ProgramFilesx86/MicrosoftVisualStudio10/VC/include.

installation is over...
for more details you can read programming principles and practice using c++ by Stroustrup.

屋檐 2024-10-07 09:06:02

我有一篇博客文章向您展示了如何操作。

它是在 VS2003 中完成的,但相同的指令在 VS2010 中同样有效。

安装后,解压缩并构建 fltk 下载,您应该确保在项目属性中注意以下事项:

  1. 添加所需的附加包含目录。
  2. 在项目属性->链接器->输入->其他依赖项,确保已包含 {fltkd、wsock32、comctl32}.lib 库。
  3. 在项目属性->链接器->一般->其他库目录,确保给出 fltk 库文件的正确路径。
  4. 在项目属性-> C/C++->代码生成->运行时库字段,确保选择“多线程调试 DLL (/MDd)”字段。

然后,您应该能够尝试一个简单的示例,例如以下“Hello World”示例:

#include <FL/Fl.H>  
#include <FL/Fl_Window.H>  
#include <FL/Fl_Box.H>  

int main(int argc, char **argv)  
{  
  Fl_Window *window = new Fl_Window(300,180);  
  Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");  
  box->box(FL_UP_BOX);  
  box->labelsize(36);  
  box->labelfont(FL_BOLD+FL_ITALIC);  
  box->labeltype(FL_SHADOW_LABEL);  
  window->end();  
  window->show(argc, argv);  
  return Fl::run();  
} 

I have a blog posting that shows you how.

It was done in VS2003 but the same instructions on there have been seen to work equally as well in VS2010.

After installing, unzipping and building the fltk download, you should make sure that the following things are taken care of in your project properties:

  1. Add the required additional include directories.
  2. In the Project Properties -> Linker -> Input -> Additional Dependencies, ensure the {fltkd, wsock32, comctl32}.lib libraries have been included.
  3. In the Project Properties -> Linker -> General -> Additional Library Directories, ensure the correct path for the fltk library files is given.
  4. In the Project Properties -> C/C++ -> Code Generation -> Runtime Library field, make sure the “Multi-threaded Debug DLL (/MDd)” field is chosen.

You should then be in a position to try a simple example such as the following "Hello World" sample:

#include <FL/Fl.H>  
#include <FL/Fl_Window.H>  
#include <FL/Fl_Box.H>  

int main(int argc, char **argv)  
{  
  Fl_Window *window = new Fl_Window(300,180);  
  Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");  
  box->box(FL_UP_BOX);  
  box->labelsize(36);  
  box->labelfont(FL_BOLD+FL_ITALIC);  
  box->labeltype(FL_SHADOW_LABEL);  
  window->end();  
  window->show(argc, argv);  
  return Fl::run();  
} 
软的没边 2024-10-07 09:06:02

十年前,Greg Ercolano 制作了一个有关如何设置使用 FLTK 的 Visual Studio 7 项目的视频。观看他的精彩(FLTK 相关)视频。该过程与任何较新的 Microsoft(R) VisualStudio(TM) 应该没有太大不同。另外,我强烈建议您查看 Greg 的“FLTK Cheat Sheet”页面。

A decade ago Greg Ercolano made a video about how to setup Visual Studio 7 project that uses FLTK. Take a look at his excellent (FLTK related) videos. The process should not be much different with any newer Microsoft(R) VisualStudio(TM). Also, I highly recommend taking a look at Greg's "FLTK Cheat Sheet" page.

偏爱你一生 2024-10-07 09:06:02

我知道这个问题已经很老了,但是......

现在FLTK可以直接通过NuGet安装。无需手动执行任何操作。

https: //blogs.msdn.microsoft.com/vcblog/2015/02/13/find-your-favorite-library-for-c-in-nuget/

只需使用 NuGet 包管理器搜索“FLTK”即可。

I understand that this question is old, but...

Now FLTK can be installed directly via NuGet. No need to do anything manually.

https://blogs.msdn.microsoft.com/vcblog/2015/02/13/find-your-favorite-library-for-c-in-nuget/

Just search "FLTK" using the NuGet Package Manager.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文