VC6下编译fltk-1.3.5
生活随笔
收集整理的這篇文章主要介紹了
VC6下编译fltk-1.3.5
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
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也可以編譯成功
總結
以上是生活随笔為你收集整理的VC6下编译fltk-1.3.5的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [置顶] 高效前端优化工具
- 下一篇: oracle windows系统下卸载o