Replies: 2 comments
-
mode in this case is a local variable in the BindOTRMode function. The add_option takes a reference to it, which becomes invalid when the method returns. Thus when your app uses the -m option, and tries to assign something to it you will get a seg fault in most cases. The string you bind in that case needs to live beyond the parse call. Most of the time when I do something like this the data for a subcommand lives in a class that gets instantiated in the main loop, or something similar. |
Beta Was this translation helpful? Give feedback.
-
Thanks! That did it! (I just moved everything into main) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In WSL2 Ubuntu, I get a seg fault in
_parse()
. I think I'm using C++ 20 gcc, cmake./CubeOS generate -m code
<-- seg faults./CubeOS generate
<-- works fine./CubeOS generate -m
<-- help text pops up as normalAny ideas what might be going wrong?
Beta Was this translation helpful? Give feedback.
All reactions