回复: boost.gil build fail ed with GCC11 and -std=c++20

Qiang Ren via Boost-users <[email protected]>
Newsgroups gmane.comp.lib.boost.user
Message-ID <DM6PR18MB2780749BD2E55BBFC2EA474984509@DM6PR18MB2780.namprd18.prod.outlook.com>
Hi, Mateusz,

I manually merge the chagelist and now it works fine.


Thank you very much.
Frank




________________________________
发件人: Boost-users <[email protected]> 代表 Mateusz Loskot via Boost-users <[email protected]>
发送时间: 2022年1月8日 4:09
收件人: [email protected] <[email protected]>
抄送: Mateusz Loskot <[email protected]>
主题: Re: [Boost-users] boost.gil build failed with GCC11 and -std=c++20

On Fri, 7 Jan 2022, 15:25 Qiang Ren via Boost-users, <[email protected]<mailto:[email protected]>> wrote:
Hi,

I am on ubuntu 20.04, I have GCC9.4 and 10.3 and 11.1 installed.

I found that when set "-std=c++20", with gcc11, boost.gil will failed to build.

Here is the simple test cpp to reproduce the issue:

#include <sstream>
#include <boost/gil.hpp>
#include <boost/gil/extension/io/png.hpp>

namespace gil = boost::gil;

int main()
{
  gil::rgb8_image_t img;
  std::stringstream buf(std::ios::in | std::ios::out | std::ios::binary);
  gil::read_and_convert_image(buf, img, gil::png_tag{});

  return 0;
}

the build command is:
g++ -o test test_gcc11_gil.cc -std=c++20 -I${THIRD_PARTY}/boost/boost_1_78_0 -L${THIRD_PARTY}/libpng/1.6.37/lib/ -lpng

If replaced '-std=c++20' with '-std=c++17', the build would be OK,  but with 'c++20', gcc 11 failed with the following errors:

In file included from /data/lin/ThirdParty/boost/boost_1_78_0/boost/gil/extension/io/png/read.hpp:13,
from /data/lin/ThirdParty/boost/boost_1_78_0/boost/gil/extension/io/png.hpp:11,
from test_gcc11_gil.cc:3:
/data/lin/ThirdParty/boost/boost_1_78_0/boost/gil/extension/io/png/tags.hpp:576:32: error: expected unqualified-id before ‘)’ token
576 |     image_read_info< png_tag >()
|                                ^


https://github.com/boostorg/gil/issues/616

Best regards,
Mateusz


<https://lists.boost.org/mailman/listinfo.cgi/boost-users>

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.