Boost logo

Boost Users :

Subject: Re: [Boost-users] GIL: New file io, almost there, but can't compile 'write_view'
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2018-12-08 10:34:35

On Sat, 8 Dec 2018 at 02:46, Dan Bloomquist via Boost-users
<boost-users_at_[hidden]> wrote:
> I get to my code, in case it matters:
> bg::rgb8_image_t destImg( res, x );
> resize_view( view( sourceImg ), view( destImg ),
> bg::bilinear_sampler( ) );
> and rgb8_image_t should be a good one from what I read:
> <>

At glance, the docs look fine.

> With either:
> bg::write_view( path_to, destImg, bg::jpeg_tag() );
> or:
> bg::image_write_info<bg::jpeg_tag> write_setttings;
> bg::write_view( path_to, destImg, write_setttings );
> ms140 complains:
> 1>C:\cpp\boost_1_68_0\boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp(33):
> error C2039: 'reference': is not a member of
> 'boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned
> char>>'
> 1> c:\cpp\boost_1_68_0\boost\gil\typedefs.hpp(176): note: see
> declaration of
> 'boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned
> char>>'
> 1> console_test.cpp(248): note: see reference to class template
> instantiation 'boost::gil::get_pixel_type<boost::gil::rgb8_image_t>'
> being compiled
> 1>C:\cpp\boost_1_68_0\boost/gil/extension/toolbox/metafunctions/get_pixel_type.hpp(34):
> error C2146: syntax error: missing '>' before identifier 'reference'
> What am I missing?

I suspect, you are missing some headers.

I have just updated GIL example resize.cpp to catch it up with the new GIL IO

I verified it compiles without errors using Visual Studio 2017 15.9.3
Preview 1.0
(FYI, I configured x64 build with Ninja using the CMake configuration
provided and

Please, git pull and git checkout develop branch, and try out the example
if it compiles for you as well. I hope it does.
If it does, compare your program against it to see what is different/missing.

p.s. FYI, if you prefer, there is also

Best regards,

Mateusz Loskot,

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at