Comments (3)
The full compiler output for the error is:
1>main.cpp
1>E:\Projects\CPP\boost\boost\exception\exception.hpp(297,6): error C3084: 'boost::exception::~exception': a destructor cannot be 'abstract'
1>E:\Projects\CPP\boost\boost\function\function_template.hpp(761): message : see reference to function template instantiation 'void boost::throw_exception<boost::bad_function_call>(const E &)' being compiled
1> with
1> [
1> E=boost::bad_function_call
1> ]
1>E:\Projects\CPP\boost\boost\function\function_template.hpp(759): message : while compiling class template member function 'void boost::function1<void,const T &>::operator ()(T0) const'
1> with
1> [
1> T=std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>,
1> T0=const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>> &
1> ]
1>E:\Projects\CPP\boost\boost\program_options\detail\value_semantic.hpp(45): message : see reference to function template instantiation 'void boost::function1<void,const T &>::operator ()(T0) const' being compiled
1> with
1> [
1> T=std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>,
1> T0=const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>> &
1> ]
1>E:\Projects\CPP\boost\boost\program_options\value_semantic.hpp(373): message : see reference to class template instantiation 'boost::function1<void,const T &>' being compiled
1> with
1> [
1> T=std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>
1> ]
1>E:\Projects\CPP\ModuleTest\main.cpp(15): message : see reference to class template instantiation 'boost::program_options::typed_value<std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>,char>' being compiled
from program_options.
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.
from program_options.
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 #define
a symbol that changes how the header is imported. Basically, you can't #define _UNICODE
and then import <Windows.h>;
because when the compiler goes to compile Windows.h, it doesn't see that #define
.
As for why this is happening, I have no idea! The problem seems to stem from boost::throw_exception
. Specifically with wrapexcept
. boost::bad_function_call
derives from std::runtime_error
, but for some reason it fails to convert to a boost exception properly and results in this error.
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 #include
when dealing with boost.
from program_options.
Related Issues (20)
- parse_config_file: alternate comment interpretation HOT 1
- canonical_name option for error_with_option_name is giving NULL string
- Boost 1.76.0 Error HOT 1
- Boost release tag frozen since 3 years ? HOT 3
- program_options support std::vector and not boost::container::vector
- Why doesn't `allow_unregistered` work for me?
- Supplying a list of possible values instead of a default value to an option?
- Visual Studio 2022 error LNK1104 HOT 1
- Link Error when use variables_map::contains method HOT 1
- Potential Cmake issue. Not able to get secondary dependency when including in own helloworld-app HOT 1
- crash with one dash HOT 3
- Gaps between specification and implementation in typed_value::composing()
- Link error with CMake (undefined symbols), not observed when compiling manually HOT 2
- Please add utf-8 support for c++20 HOT 1
- boost::program_options::parse_command_line crashes with argc of ISO Cpp valid value of 0 HOT 3
- Add Transparent Comparator Support
- Compilation failure with Clang 17 and `-std=cpp23` HOT 2
- symbol visibility problem on macOS HOT 1
- Duplicate option not detected when added
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from program_options.