VC6下编译fltk-1.3.5
?
FLTK官方地址:https://www.fltk.org/index.php
fltk-1.1.10編譯說(shuō)明
打開(kāi)visualc/fltk.dsw文件
編譯fltk工程得到fltk.lib
編譯hello工程,一個(gè)最簡(jiǎn)單的例子編譯完畢
?
fltk-1.3.5編譯說(shuō)明
工程位置在ide/VisualC6/fltk.dsw
要依次編譯fltk_zib,fltk_jepg,fltk_png
接下來(lái)fltk才可以編譯,不會(huì)會(huì)報(bào)錯(cuò),但改起來(lái)也比較簡(jiǎn)單
第一個(gè)問(wèn)題,類(lèi)中靜態(tài)變量無(wú)法直接初始化(新的標(biāo)準(zhǔn)應(yīng)該支持)
涉及文件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中內(nèi)容
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;第二個(gè)問(wèn)題,for循環(huán)中變量聲明問(wèn)題,一個(gè)位置不太好,一個(gè)被視為重復(fù)聲明
fl_font_win32.cxx
for(unsigned ll = 0; ll < len; ll++) { ... }聲明放到函數(shù)開(kāi)始位置?
unsigned ll = 0; //挪到函數(shù)開(kāi)始位置 for(ll = 0; ll < len; ll++) { ... }l_gleam.cxx中 2個(gè)for循環(huán)中I被視為重復(fù)聲明
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編譯成功
最簡(jiǎn)單的例子hello也可以編譯成功
總結(jié)
以上是生活随笔為你收集整理的VC6下编译fltk-1.3.5的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: [置顶] 高效前端优化工具
- 下一篇: c++ GUI轻量工具包FLTK介绍 (