Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

program_options.hpp fails when imported as a header unit (MSVC 2022).

Open
#114 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
cli

Research direction

Start by compiling the supplied main.cpp with MSVC 2022 in C++20 mode and importing boost/program_options.hpp as a header unit. Inspect boost/exception/exception.hpp around line 297 while comparing the header-unit failure with a normal include. Done means the example compiles successfully with the header-unit import.

Written by the indexing model from the issue text.

Description

The program fails to compile when trying to import program_options.hpp as a header unit in Visual Studio 2022 (C++20).

main.cpp

import <boost/program_options.hpp>;

int main(int argc, char** argv)
{
	namespace po = boost::program_options;
	po::options_description desc;
	desc.add_options()
		("stringtest", po::value<std::string>()->implicit_value("test"), "string test")
		;

	return 0;
}

You'll get the following error:
Error - C3084 - 'boost::exception::~exception': a destructor cannot be 'abstract' - solution - E:\Projects\CPP\boost\boost\exception\exception.hpp - 297

I haven't had any troubles with any other boost headers. This is the only one I've run into with this issue. This was tested with the latest master branch.

Dominant language
C++
Stars
136
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/program_options

All issues in boostorg/program_options

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.