MSVC中的FLTK是否需要x11标头? [英] FLTK in MSVC needs x11 headers?

查看:116
本文介绍了MSVC中的FLTK是否需要x11标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习如何立即使用FLTK(在MSVC 2008中).我正确编译了所有库,但是当我尝试运行该程序时:

I'm trying to learn how to use FLTK right now (In MSVC 2008). I got all the the libraries compiled correctly, but when I tried to run this program:



    #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(340, 180);
        Fl_Box *box = new Fl_Box(20, 40, 300, 100, "Hello, World!");
        box->box(FL_UP_BOX);
        box->labelfont(FL_BOLD + FL_ITALIC);
        box->labelsize(36);
        box->labeltype(FL_SHADOW_LABEL);
        window->end();
        window->show();

        return Fl::run();
    }

我收到此错误



    1>c:\fltk\fl\xutf8.h(33) : fatal error C1083: Cannot open include file: 'X11/X.h': No such file or directory

我可以说它丢失了x11,但是我在Google上进行了快速搜索,但找不到关于此主题的任何帮助.顺便说一句,我正在运行v1.3.0.

I can tell that it is missing x11, but I did a quick google search, and I couldn't find any help on this subject. BTW, I'm running v1.3.0.

感谢您的时间.

推荐答案

我找到了答案,在包含FLTK之前添加"#define WIN32".

I found the answer, add "#define WIN32" before your FLTK includes.

这篇关于MSVC中的FLTK是否需要x11标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆