Could Not Convert to a bool

General questions regarding the usage of CodeLite
ColleenKobe
CodeLite Veteran
Posts: 99
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Could Not Convert to a bool

Post by ColleenKobe » Thu Jun 21, 2018 6:59 pm

I'm having an execution problem with my program. When I build my program and run it:

I correctly get a wxMessageBox displayed when code execution hits my main.cpp Constructor code. I click OK and there's a brief pause. Then the MainFrame page appears to be correctly displayed. Immediately, a new brief message is displayed that looks something like this:
wxWidgets Debug Alert

A debugging check in this application has failed. ../../src/common/variant(681): assert "Assert Failure" failed in GetBool...Could not convert to a bool.

[ ] Don't show this message again.
This message is displayed for MAAAAYBE 1.5 seconds, and then the message disappears and the program ends. It's up and gone so quickly I don't have time to read the whole message. I have tried many times to get a Printscreen of the message, but the clipboard is always empty when I tried to paste it into Paint.

Questions.

1. Any idea why the program crashes so quickly? How can I get it to slow down or stop, so I can read the whole message? In the Main program's CodeLite Settings page, the General Tab, I have already clicked the checkbox "Pause when execution ends."

2. Is there any way in the world to track down where the code is bombing? I have put breakpoints in every procedure in main.cpp, including OnInit and the MainApp constructor, but none of the breakpoints gets triggered. The "Call Stack" tab in CodeLite is empty. I've started going through my code for if statements, making sure that every condition contains either "== true" or "== false".

Another data point: when I open a smaller, different CodeLite workspace, and compile and build that code, it runs perfectly. So clearly, my problem is somewhere in my big program's workspace.

I am only looking for suggestions about where to start looking. I know I haven't given you very many clues about what my code does or what its architecture is like.

I cannot post code snippets, because my workspace is just too large. It consists of four projects containing a total of 65 *.c, *.h, and *.cpp files. A few of the files are over 4,000 lines long. Plus there are the CodeLite settings to consider. Since I don't know where the problem is, I wouldn't know where to even start.

Thanks for reading this far. :-)

Colleen

DavidGH
CodeLite Plugin
Posts: 568
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Could Not Convert to a bool

Post by DavidGH » Thu Jun 21, 2018 9:15 pm

It is hard to imagine how this could be caused by CodeLite. Why did you not ask on wxForum?

ColleenKobe
CodeLite Veteran
Posts: 99
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Could Not Convert to a bool

Post by ColleenKobe » Fri Jun 22, 2018 3:44 pm

Hi, DavidGH,

Thanks for replying.

I did not post on wxWidgets forum for two reasons:

1) My experience with them is that they always want to see code, and I have no idea where in the code the problem is occurring.

2) I am unclear where the boundary between CodeLite and wxWidgets is. I've posted on the wxWidgets forum before, but sometimes the responders say that my problem is from CodeLite problem, not wxWidgets, and that I should have posted on the CodeLite forum. How would I know? I have only programmed wxWidgets using CodeLite.

In the end, I'm looking for someone to point me in the right direction. I'm looking for clues. Hints. Maybe someone else has had the same problem and solved it by setting some bit somewhere.

Still, if I don't get any help on the Codelite forum in the next few days, and if I still can't figure it out on my own, I'll post on the wxWidgets forum.

Colleen
Never give up, never surrender!

tjulian
CodeLite Enthusiast
Posts: 32
Joined: Tue Nov 11, 2008 12:06 am
Contact:

Re: Could Not Convert to a bool

Post by tjulian » Fri Jun 22, 2018 4:47 pm

There is this routine in wxWidgets in variant.cpp:

Code: Select all

bool wxVariant::GetBool() const
{
    bool value;
    if (Convert(& value))
        return value;
    else
    {
        wxFAIL_MSG(wxT("Could not convert to a bool"));
        return 0;
    }
}
Looks like a good place to start.

ColleenKobe
CodeLite Veteran
Posts: 99
Joined: Wed Mar 30, 2016 4:31 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Could Not Convert to a bool

Post by ColleenKobe » Fri Jun 22, 2018 5:08 pm

Hi, tjulian,

Thank you! That is indeed a place to start. :-) I'm on it.

Colleen
Never give up! Never surrender!

marcelinux
CodeLite Enthusiast
Posts: 17
Joined: Mon Nov 02, 2015 3:26 pm
Genuine User: Yes
IDE Question: C++
Location: Spain
Contact:

Re: Could Not Convert to a bool

Post by marcelinux » Fri Jun 22, 2018 6:16 pm

ColleenKobe wrote:2. Is there any way in the world to track down where the code is bombing?
Log system is generally the best approach.
You could mark initially your functions and see a brief call-stack.
Only as a suggestion.

Good luck.

DavidGH
CodeLite Plugin
Posts: 568
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: Could Not Convert to a bool

Post by DavidGH » Fri Jun 22, 2018 6:26 pm

I am unclear where the boundary between CodeLite and wxWidgets is
CodeLite things:
  • CodeLite itself crashes.
    You can't get CodeLite to do something it should be able to do.
    You have a question about some CodeLite function e.g. how to save a Perspective.
    You wish to discuss a patch or feature request for CodeLite.
Non-CodeLite things:
Anything else. In particular:
  • Anything to do with wxWidgets code.
    Anything to do with your code e.g. crashing or not working correctly.
So, of your recent threads, IMO http://codelite.org/forum/viewtopic.php?f=11&t=3933 http://codelite.org/forum/viewtopic.php?f=18&t=3855 http://codelite.org/forum/viewtopic.php?f=18&t=3851 http://codelite.org/forum/viewtopic.php?f=11&t=3830 were correctly asked here, while http://codelite.org/forum/viewtopic.php?f=11&t=3936 http://codelite.org/forum/viewtopic.php?f=18&t=3807 http://codelite.org/forum/viewtopic.php?f=11&t=3753 were not.

Post Reply