Skip to content
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

Exception when calling xxx.as<T>()... #374

Open
FredM67 opened this issue Oct 13, 2022 · 2 comments
Open

Exception when calling xxx.as<T>()... #374

FredM67 opened this issue Oct 13, 2022 · 2 comments

Comments

@FredM67
Copy link

FredM67 commented Oct 13, 2022

I've a project under MSVC 2017. If CXXOPTS_NO_RTTI is not defined, any call to xxx.as<T>() produce an exception.

Exception occurs at line 1458 of cxxopts.hpp, deeper at line 291 of rtti.cpp.

Unhandled exception at 0x00007FFAB6D24FD9 in bla.exe: Microsoft C++ exception: std::__non_rtti_object at memory location 0x000000FEE92FE820.

@jarro2783
Copy link
Owner

I'll take a look.

@jarro2783
Copy link
Owner

It looks like you need to also define CXXOPTS_NO_EXCEPTIONS, CXXOPTS_NO_RTTI only turns off dynamic vs static casting. I'm not sure if there is any benefit having those separated, I might just combine them into one option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants