解决Bug in Fl_JPEG_Image: compile fltk-1.3.3 on gcc-4.6.4
来源:互联网 发布:建筑结构优化案例分析 编辑:程序博客网 时间:2024/06/06 05:09
On gcc-4.8,the compilation of fltk-1.3.3-source.tar.gz goes smoothly. But downgrade gcc to 4.6.4, while re-compiling the same code, the following erro came up.
sudo tar -xvf fltk-1.3.3-source.tar.gz
cd fltk-1.3.3/
mkdir bin
cd bin
sudo ccmake ../
sudo make
The following erro shows up:
[ 53%] Building CXX object src/CMakeFiles/fltk_images.dir/Fl_GIF_Image.cxx.o
[ 54%] Building CXX object src/CMakeFiles/fltk_images.dir/Fl_Help_Dialog.cxx.o
[ 54%] Building CXX object src/CMakeFiles/fltk_images.dir/Fl_JPEG_Image.cxx.o
/usr/local/src/fltk-1.3.3/src/Fl_JPEG_Image.cxx: In constructor ‘Fl_JPEG_Image::Fl_JPEG_Image(const char*)’:
/usr/local/src/fltk-1.3.3/src/Fl_JPEG_Image.cxx:158:29: error: invalid conversion from ‘int’ to ‘boolean’ [-fpermissive]
/usr/local/include/jpeglib.h:1039:13: error: initializing argument 2 of ‘int jpeg_read_header(j_decompress_ptr, boolean)’ [-fpermissive]
/usr/local/src/fltk-1.3.3/src/Fl_JPEG_Image.cxx: In constructor ‘Fl_JPEG_Image::Fl_JPEG_Image(const char*, const unsigned char*)’:
/usr/local/src/fltk-1.3.3/src/Fl_JPEG_Image.cxx:340:29: error: invalid conversion from ‘int’ to ‘boolean’ [-fpermissive]
/usr/local/include/jpeglib.h:1039:13: error: initializing argument 2 of ‘int jpeg_read_header(j_decompress_ptr, boolean)’ [-fpermissive]
make[2]: *** [src/CMakeFiles/fltk_images.dir/Fl_JPEG_Image.cxx.o] Error 1
make[1]: *** [src/CMakeFiles/fltk_images.dir/all] Error 2
make: *** [all] Error 2
To fix:
sudo gedit /usr/local/src/fltk-1.3.3/src/Fl_JPEG_Image.cxx
Replace this function declaration (in both 158 and 340 line) as:
jpeg_read_header(&dinfo, 1); //the original
with
jpeg_read_header(&dinfo, TRUE); //the changed
sudo make
sudo make install
Finished!!
This bug is detailed and solved in:
http://www.fltk.org/str.php?L2920
http://blog.gmane.org/gmane.comp.lib.fltk.bugs/month=20130101
- 解决Bug in Fl_JPEG_Image: compile fltk-1.3.3 on gcc-4.6.4
- build FLTK 1.1.7 with gcc 2.95.3 on Fedora7
- Unsolved bug in fltk-1.1.10/src/filename_list.cxx for scandir --已解决!
- How to compile GCC-4.3.3 in the Linux?
- How to compile GCC-4.3.3 in the cygwin?
- Compile and install GCC in home directory
- 【bug】Could not find method compile() 解决
- arm-linux-gcc compile the cross-platform mpich2 on ubuntu
- GCC Intro - Compile 32-bit Application on 64-bit ubuntu
- XCode 4 - using GCC 4.0 to compile?
- [C++] Build Shared libraries with GCC on Linux ---gcc is actually for compile C
- gcc编译的bug? (已解决)
- Compile JThread 4 Android On Ubuntu
- how to compile android2.3 on ubuntu14
- 64-bit gcc-4.6 Ubuntu12.04 成功编译 fltk-1.1.10-source.tar.gz
- 解决Failed to ... maven-compiler-plugin:3.1:compile (default-compile) on project ...
- FLTK
- gcc-4.6 居然bug了.
- 备份管理多个git项目
- UVA - 10719 Quotient Polynomial
- shell命令join
- 为notepad++添加g++编译器编译objc/c/c++/C#
- 智能浮动
- 解决Bug in Fl_JPEG_Image: compile fltk-1.3.3 on gcc-4.6.4
- 关于android的帧动画,对于2.3版本的不支持问题。
- Mongodb的数据备份与删除
- 【bzoj 1025】: [SCOI2009]游戏
- 云计算和网格计算差别何在
- Android之permission权限列表
- ubuntu 12.04 Wine 找不到 gnome-keyring-pkcs11.so 的解决方法
- 缓冲区溢出攻击与防护
- 悠悠岁月,匆匆2014