1

I'm trying to follow the boost gil tutorial - the official documentation here

But I stumbled upon some weird errors while trying to read the image, don't really know what those mean. Any ideas guys?

My code:

#include <boost/gil/image.hpp>
#include <boost/gil/extension/io/jpeg.hpp>
#include <string>
using namespace boost::gil;

int main() {
    std::string filename("LittleMit.jpg");
    rgb8_image_t img;
    read_image(filename, img, jpeg_tag());
    return 0;
}

Here are the errors I got (kinda long though):

c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\extension\io\jpeg\detail\reader_backend.hpp(266): error C2664: 'size_t boost::gil::detail::file_stream_device<FormatTag>::read(boost::gil::byte_t *,::size_t)': cannot convert argument 1 from 'JOCTET [4096]' to 'boost::gil::byte_t *'
        with
        [
           FormatTag=boost::gil::jpeg_tag
       ]
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\extension\io\jpeg\detail\reader_backend.hpp(266): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\extension\io\jpeg\detail\reader_backend.hpp(264): note: while compiling class template member function 'boolean boost::gil::reader_backend<Device,boost::gil::jpeg_tag>::fill_buffer(jpeg_decompress_struct *)'
        with
        [
            Device=boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>
        ]
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\extension\io\jpeg\detail\reader_backend.hpp(121): note: see reference to function template instantiation 'boolean boost::gil::reader_backend<Device,boost::gil::jpeg_tag>::fill_buffer(jpeg_decompress_struct *)' being compiled
        with
        [
            Device=boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>
        ]
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\extension\io\jpeg\detail\read.hpp(59): note: see reference to class template instantiation 'boost::gil::reader_backend<Device,boost::gil::jpeg_tag>' being compiled
        with
        [
            Device=boost::gil::detail::file_stream_device<boost::gil::jpeg_tag>
        ]
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\gil\io\read_image.hpp(206): note: see reference to class template instantiation 'boost::gil::reader<boost::gil::detail::file_stream_device<FormatTag>,FormatTag,ConversionPolicy>' being compiled
        with
        [
            FormatTag=boost::gil::jpeg_tag,
            ConversionPolicy=boost::gil::detail::read_and_no_convert
        ]
c:\users\minh\source\repos\boosttest\boosttest\boosttest.cpp(12): note: see reference to function template instantiation 'void boost::gil::read_image<std::string,boost::gil::rgb8_image_t,boost::gil::jpeg_tag>(const String &,Image &,const FormatTag &,void *)' being compiled
        with
        [
            String=std::string,
            Image=boost::gil::rgb8_image_t,
            FormatTag=boost::gil::jpeg_tag
        ]
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(54): note: see reference to class template instantiation 'boost::arg<9>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(53): note: see reference to class template instantiation 'boost::arg<8>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(52): note: see reference to class template instantiation 'boost::arg<7>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(51): note: see reference to class template instantiation 'boost::arg<6>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(50): note: see reference to class template instantiation 'boost::arg<5>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(49): note: see reference to class template instantiation 'boost::arg<4>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(48): note: see reference to class template instantiation 'boost::arg<3>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(47): note: see reference to class template instantiation 'boost::arg<2>' being compiled
c:\program files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\boost_1_68_0\boost\bind\placeholders.hpp(46): note: see reference to class template instantiation 'boost::arg<1>' being compiled
Alex_M1612
  • 33
  • 2
  • I have just tried your code sample, successfully compiling it on Linux using GCC 5.5, 7.3, 8.2 and Boost.GIL from the latest `develop` branch. I don't see any issues. Sorry, but I can't help with MinGW, I don't use it. – mloskot Dec 08 '18 at 15:52

0 Answers0