Opened 8 years ago

Last modified 5 years ago

#10272 new Bugs

property_tree commit 8af8b6b breaks VS2013 64-bit build

Reported by: mevatron@… Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost Development Trunk Severity: Problem
Keywords: xml_parser_writer_settings Cc: mika.fischer@…

Description

I was attempting to build the PointCloudLibrary using the 1.56.0_beta1 binary from SourceForge; however, I encountered the following compilation errors when doing so:

C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(38): error C2825: 'Str': must be a class or namespace when followed by '::' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
          C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(201) : see reference to class template instantiation 'boost::property_tree::xml_parser::xml_writer_settings<char>' being compiled
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(38): error C2039: 'value_type' : is not a member of '`global namespace'' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(38): error C2146: syntax error : missing ';' before identifier 'Ch' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(38): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(40): error C2061: syntax error : identifier 'Ch' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(49): error C2146: syntax error : missing ';' before identifier 'indent_char' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(49): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(50): error C2825: 'Str': must be a class or namespace when followed by '::' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(50): error C2039: 'size_type' : is not a member of '`global namespace'' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(50): error C2146: syntax error : missing ';' before identifier 'indent_count' (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\boost-1_56_0_b1\boost/property_tree/detail/xml_parser_writer_settings.hpp(50): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp)
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(201): error C2661: 'boost::property_tree::xml_parser::xml_writer_settings<char>::xml_writer_settings' : no overloaded function takes 2 arguments
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(203): error C2664: 'void boost::property_tree::xml_parser::write_xml<boost::property_tree::ptree>(const std::string &,const Ptree &,const std::locale &,const boost::property_tree::xml_parser::xml_writer_settings<Key> &)' : cannot convert argument 4 from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key> &'
          with
          [
              Ptree=boost::property_tree::ptree
  ,            Key=std::string
          ]
          and
          [
              Key=std::string
          ]
          Reason: cannot convert from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key>'
          with
          [
              Key=std::string
          ]
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(221): error C2661: 'boost::property_tree::xml_parser::xml_writer_settings<char>::xml_writer_settings' : no overloaded function takes 2 arguments
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(227): error C2664: 'void boost::property_tree::xml_parser::write_xml<boost::property_tree::ptree>(const std::string &,const Ptree &,const std::locale &,const boost::property_tree::xml_parser::xml_writer_settings<Key> &)' : cannot convert argument 4 from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key> &'
          with
          [
              Ptree=boost::property_tree::ptree
  ,            Key=std::string
          ]
          and
          [
              Key=std::string
          ]
          Reason: cannot convert from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key>'
          with
          [
              Key=std::string
          ]
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(282): error C2661: 'boost::property_tree::xml_parser::xml_writer_settings<char>::xml_writer_settings' : no overloaded function takes 2 arguments
C:\Users\Will\Source\pcl.git\io\src\lzf_image_io.cpp(287): error C2664: 'void boost::property_tree::xml_parser::write_xml<boost::property_tree::ptree>(const std::string &,const Ptree &,const std::locale &,const boost::property_tree::xml_parser::xml_writer_settings<Key> &)' : cannot convert argument 4 from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key> &'
          with
          [
              Ptree=boost::property_tree::ptree
  ,            Key=std::string
          ]
          and
          [
              Key=std::string
          ]
          Reason: cannot convert from 'boost::property_tree::xml_parser::xml_writer_settings<char>' to 'const boost::property_tree::xml_parser::xml_writer_settings<Key>'
          with
          [
              Key=std::string
          ]
          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

Reverting the property_tree module back to commit 85f8d8866ccfa98e4a667343529adb411bd67d08 corrected the build problem I was having.

Thanks, Will

Change History (23)

comment:1 by anonymous, 8 years ago

Fix on github. ID 4e16d57fa634fc9ddb64cde1c687e11e23b6e34a

comment:2 by nullable.type@…, 8 years ago

There are two superfluous typename's in the char specialization of xml_writer_settings (in xml_parser_writer_settings.hpp, line 59 and 68). This leads at least with Visual Studio 2013 and g++ 4.8.2 to compilation errors.

Please see the comment in the respective pull request.

in reply to:  2 comment:3 by mevatron@…, 8 years ago

Replying to nullable.type@…:

There are two superfluous typename's in the char specialization of xml_writer_settings (in xml_parser_writer_settings.hpp, line 59 and 68). This leads at least with Visual Studio 2013 and g++ 4.8.2 to compilation errors.

Please see the comment in the respective pull request.

Sorry for the late reply, but just tested this commit, and it compiles correctly now with VS2013 Update 3. Any idea when this fix will make it's way into the Boost mainline?

Thanks again for the fix! Will

comment:4 by Sebastian Redl, 8 years ago

Current master and develop branch compile just fine for me without any fix - could this have been fixed by a VS update?

I'm very reluctant to include the fix, since it duplicates a lot of code for no reason that I can see.

comment:5 by kwaegel, 8 years ago

I am getting these exact same errors using Boost 1.57.0 and Visual Studio 2013 update 4.

comment:6 by Mika Fischer <mika.fischer@…>, 8 years ago

Cc: mika.fischer@… added

comment:7 by Mika Fischer <mika.fischer@…>, 8 years ago

This bug is still present in 1.58.0 with VS 2013

comment:8 by anonymous, 7 years ago

Same here - the same error with 1.58.0 and VS2013 Update 4.

comment:9 by anonymous, 7 years ago

Boost 1.59.0 Visual studio 2008 SP1 64bits, same problem

comment:10 by anonymous, 7 years ago

Same problem with Boost 1.59.0 vs2015 update 1

comment:11 by anonymous, 7 years ago

Same problem with Boost 1.60.0 vs2013 update 5

comment:12 by anonymous, 7 years ago

Sorry, I take that back. Works fine with Boost 1.60.0 vs2013 update 5

comment:13 by anonymous, 7 years ago

Disregard the last comment, it does NOT work with Boost 1.60.0 vs2013 update 5

comment:14 by ramasamy.vignesh@…, 7 years ago

I am getting the same error in Boost 1.60 with Visual Studio 2015 Update 1. I also searched for commit Id 4e16d57fa634fc9ddb64cde1c687e11e23b6e34a in GitHub which is not available. Any other solution for the error ? Please recommend.

comment:15 by anonymous, 7 years ago

We're encountering this issue as well on boost 1.60 in our codebase.

Here's a link to the aforementioned fix on github, and a discussion of why it's not yet in the mainline.

http://lists.boost.org/Archives/boost/2014/08/215859.php

comment:16 by anonymous, 6 years ago

We encountered the same error with Visual Studio 2015 Update 3 && Boost 1.61.

comment:17 by anonymous, 6 years ago

I reverted the property_tree header files to version 1.54 and the problem went away.

comment:18 by anonymous, 6 years ago

I have the same problem with Visual Studio 2013 Update 5 (64bit) when using any Boost version between 1.56 and 1.61 (1.62 not tested). Boost 1.55 is working ok. Any updates or hints? I am stuck with Boost 1.55 for a while now.

comment:19 by anonymous, 6 years ago

I'm still hitting this with Visual Studio 2015 - update 3, compiling 64 bit with boost 1.61

in reply to:  18 comment:20 by anonymous, 6 years ago

I have seen that even big opensource projects like e.g. QGIS (qgis.org) are still using Boost 1.55 (two years old) and do not update to newer Boost versions - the question is if the reason is also related to this bug (breaking Visual Studio builds with Boost newer than 1.55)

comment:21 by mevatron@…, 6 years ago

I'm not sure if this particular bug is the reason projects are holding back on upgrading; however, I'm currently working around this bug with the following:

#include <boost/version.hpp>
...
#if (BOOST_VERSION >= 105600)
    xml_writer_settings<std::string> settings('\t', 1);
#else
    xml_writer_settings<char> settings('\t', 1);
#endif

It would definitely be nice to get this fixed properly.

in reply to:  21 comment:22 by anonymous, 5 years ago

Replying to mevatron@…:

I'm not sure if this particular bug is the reason projects are holding back on upgrading; however, I'm currently working around this bug with the following:

#include <boost/version.hpp>
...
#if (BOOST_VERSION >= 105600)
    xml_writer_settings<std::string> settings('\t', 1);
#else
    xml_writer_settings<char> settings('\t', 1);
#endif

It would definitely be nice to get this fixed properly.

Many thanks for this really helpful hint. I agree it would be better if such workaround was not necessery and this would be fixed in boost for API compatibility.

comment:23 by anonymous, 5 years ago

Still broken even in visual studio 2017 (Boost version 1.64).

Note: See TracTickets for help on using tickets.