Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8162569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:45:35+00:00 2026-06-06T18:45:35+00:00

Note: Boost’s archive scheme is based on symmetrical input and output archive classes. It’s

  • 0

Note:
Boost’s archive scheme is based on symmetrical input and output archive classes. It’s tedious to write about both of them all the time, so I’ll use ?archive to mean both oarchive and iarchive.

Summary:
After changing the base classes of my custom archives from binary_?archive_impl to text_?archive_impl, my custom archive classes are no longer “found” when the compiler is instantiating the serialize(...) methods in my other classes.

Background:
My application was successfully reading and writing files to disk using subclasses of binary_?archive_impl (the documentation and/or code comments recommend this over deriving from binary_?archive). I needed to switch from a binary file format to a text format, so I switched the base classes of my custom archives to text_?archive_impl. That’s when everything blew up.

The problem:
My custom archive classes add functionality, including some additional methods which do not exist in their Boost base classes; these methods are called in the serialize(...) methods in many of my classes, and they were working fine. After changing the base classes from binary_?archive_impl to text_?archive_impl, I received compilation errors all over the place complaining that my custom methods do not exist in text_?archive. Well, that’s obvious (!!!), but they do exist in my custom archives, and they were working just fine when I was using Boost’s binary base classes. What’s the deal?

What I found, and my temporary – but undesirable – solution:
After tearing my hair out and going around in circles for about a day, this is what I found…

1) Some time ago (Boost 1.34 I believe), the files “binary_?archive.hpp” were split up into “binary_?archive_impl.hpp” and “binary_?archive.hpp” (the latter #include the former). This was not done to “text_?archive.hpp”. (As a result, I changed my application’s #include lines from “binary_?archive_impl.hpp” to simply “text_?archive.hpp”.)

2) If I split up “text_?archive.hpp” into two parts and #include only the “…_impl.hpp” headers, everything works. (But I really don’t want to modify my Boost installation!)

3) Looking more closely at these headers and fiddling around a bit, I found that if I use the original, unmodified headers and comment out the line

BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive)

(and likewise for text_iarchive), then everything works fine again. (By the way I have similar lines in my own archive code to “register” my custom archives.)

The mystery, and my dilemma:
A) Why does the presence of those lines foul up the works? …and why does removing them make things work? …and what might I have broken (without knowing it) by doing so?

B) Why were the “text_?archive.hpp” files not split up along with the “binary_?archive.hpp” files a long time ago? (Is the library broken? Should it be fixed?)

C) Is there any way to solve this in my application code without modifying my Boost installation?

P.S. I’m using Boost 1.48 and Visual Studio 2010 (64-bit)
P.P.S. I imagine all of the above would apply equally to text_w?archive

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:45:37+00:00Added an answer on June 6, 2026 at 6:45 pm

    As best I can tell its a bug in boost serialize. We’ll see here.

    A)
    1. Adding BOOST_SERIALIZATION_REGISTER_ARCHIVE with you new archive does not work because the default text archives have already been registered – only on registration seems to be allowed.
    2. Removing them makes it work because only your custom classes are registered.
    3. By removing them you’ve broken the ability to use the default text archive – your classes will be registered.

    B)
    I’m fairly certain that the “text_?archive.hpp” files should have been split up like the “binary_?archive.hpp” files are. Patch boost anyone?

    C)
    The best solution is to submit a patch to boost that splits the files up. For a temporary solution probably the best way is to put the patched files locally in your project until the patch makes it into boost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

STL/Boost cover all the low level stuff. But what about the higher level concepts?
The documentation for the uniform distribution of boost.random says Note: The current implementation is
Note: Edited based on responses to receive more appropriate answers. I have a collection
I am fairly new to both c++ and the boost library. What I want
I'm trying to write some code that uses boost::asio's sockets to send a message
NOTE: I don't think this is a duplicate of the billion other questions about
I'm trying to use boost::asio for the first time to write a process that
I'm trying to use the C++ Boost library to write some depth data I
Note: this was inspired by WebBrowser Event Properties? Why am I able to access
NOTE: I added my new solution at the UPDATE answer below. I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.