VC6下编译fltk-1.3.5

1 篇文章 0 订阅

 

FLTK官方地址:https://www.fltk.org/index.php

fltk-1.1.10编译说明

打开visualc/fltk.dsw文件

编译fltk工程得到fltk.lib

编译hello工程,一个最简单的例子编译完毕

 

fltk-1.3.5编译说明

工程位置在ide/VisualC6/fltk.dsw

要依次编译fltk_zib,fltk_jepg,fltk_png

接下来fltk才可以编译,不会会报错,但改起来也比较简单

第一个问题,类中静态变量无法直接初始化(新的标准应该支持)

涉及文件Fl_Image.H,Fl_Device.H

Fl_Image.H

class FL_EXPORT Fl_Image {  
public:
  static const int ERR_NO_IMAGE    = -1;
  static const int ERR_FILE_ACCESS = -2;
  static const int ERR_FORMAT      = -3;
  ......
}

修改为

class FL_EXPORT Fl_Image {  
public:
  static const int ERR_NO_IMAGE  ;
  static const int ERR_FILE_ACCESS ;
  static const int ERR_FORMAT    ;
  ......
}

并在Fl_Image.cxx文件中初始化

const int Fl_Image::ERR_NO_IMAGE    = -1;
const int Fl_Image::ERR_FILE_ACCESS = -2;
const int Fl_Image::ERR_FORMAT      = -3;

同样修改Fl_Device.H中内容

static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
static const int region_stack_max = FL_REGION_STACK_SIZE - 1;

修改为

static const int matrix_stack_size ;
static const int region_stack_max ;

并在Fl_Device.cxx中添加

const int Fl_Graphics_Driver::matrix_stack_size = FL_MATRIX_STACK_SIZE;
const int Fl_Graphics_Driver::region_stack_max = FL_REGION_STACK_SIZE - 1;

第二个问题,for循环中变量声明问题,一个位置不太好,一个被视为重复声明

fl_font_win32.cxx

for(unsigned ll = 0; ll < len; ll++) {
...
}

声明放到函数开始位置 

unsigned ll = 0; //挪到函数开始位置
for(ll = 0; ll < len; ll++) {
...
}

l_gleam.cxx中 2个for循环中I被视为重复声明

for (int  i = 0; i < h_top; i++, k -= step_size_top) {
...
}
...
for (int  i = 0; i < h_bottom; i++, k -= step_size_bottom) {
...
}

修改为

int i=0;
for ( i = 0; i < h_top; i++, k -= step_size_top) {
...
}
...
for ( i = 0; i < h_bottom; i++, k -= step_size_bottom) {
...
}

fltk.lib编译成功

最简单的例子hello也可以编译成功

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值