Ошибки при попытке прочитать изображение с помощью Boost Gil

Я пытаюсь следовать учебнику Boost Gil — официальная документация Вот

Но я наткнулся на некоторые странные ошибки, пытаясь прочитать изображение, на самом деле не знаю, что это значит. Есть идеи, ребята?

Мой код:

#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;
}

Вот ошибки, которые я получил (хотя и довольно долго):

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

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector