-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
program_options.hpp fails when imported as a header unit (MSVC 2022). #114
Comments
The full compiler output for the error is:
|
Thank you for the report! Unfortunately, I know next to nothing about import functionality and even less about how it might work with a compiled library, so I don't have any solution. You might want to investigate further, for example by clarifying why you expect this to work, or trying to import exception headers directly and seeing if that works. |
Importing a header compiles it as a header unit. A header unit is kinda like a precompiled header, in a way. The big thing is that the preprocessor state before the import has no effect on the contents of the header unit. It's not a simple text replacement. The compiler is processing the header file as its own separate entity. This means that you can't As for why this is happening, I have no idea! The problem seems to stem from I had expected this to work since boost libraries don't depend on your preprocessor state at all. They are all self-contained and none of the other parts of boost failed to import. But I just now tried to import stacktrace and it failed to link, so I'm thinking that maybe some of the complicated boost configuration stuff just doesn't work with modules (maybe when compiler support improves that will change). I would bet that any boost libs that aren't header-only will fail in one way or another. So I'll just stick to using |
The program fails to compile when trying to import
program_options.hpp
as a header unit in Visual Studio 2022 (C++20).main.cpp
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.
The text was updated successfully, but these errors were encountered: