Compilation problems with greg_serialize.hpp
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
Start with boost/date_time/gregorian/greg_serialize.hpp and the minimal program in the issue, then compare its dependencies with boost/archive/text_oarchive.hpp and boost/date_time/gregorian/gregorian.hpp. Verify that the intended include arrangement compiles and links without unexplained ordering requirements; done means the reported errors are resolved and the example builds successfully.
Written by the indexing model from the issue text.
Description
I noticed that the following code doesn't compile:
#include <sstream>
#include <iostream>
#include <boost/date_time/gregorian/greg_serialize.hpp>
#include <boost/archive/text_oarchive.hpp>
int main()
{
boost::gregorian::date d(2021, boost::date_time::Feb, 14);
std::ostringstream oss;
boost::archive::text_oarchive oa(oss);
oa & d;
std::cout << oss.str() << std::endl;
return 0;
}
it throws the following error:
boost/date_time/gregorian/greg_serialize.hpp:34:15: error: ‘split_free’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
And if we invert the order of the two boost inclusion headers (putting first text_oarchive.hpp and then greg_serialize.hpp) then it compiles but doesn't link:
main.cpp:(.text._ZN5boost13serialization4saveINS_7archive13text_oarchiveEEEvRT_RKNS_9gregorian4dateEj[_ZN5boost13serialization4saveINS_7archive13text_oarchiveEEEvRT_RKNS_9gregorian4dateEj]+0x36): undefined reference to `boost::gregorian::to_iso_string[abi:cxx11](boost::gregorian::date const&)'
In order to get it linked I added a new header: #include <boost/date_time/gregorian/gregorian.hpp>
So it seems that the header boost/date_time/gregorian/greg_serialize.hpp has missing dependencies, right? I didn't see any special consideration in the documentation of the library about using this header in a specific order.
- Dominant language
- C++
- Stars
- 70
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/date_time
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in boostorg/date_time
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·