Program crashing running from Xcode, but succeeds running from Terminal

Hi, ALL, I'm developing a software using C++/wxWidgets and I hit an interesting wall.

Everytime I try to run it from inside Xcode I am experiencing a crash. However, when I try to run it from the Terminal, it executes OK.

When I open the Debug Console in its output I see:

2023-01-26 08:47:02.755426-0600 dbhandler[55285:3097440] dynamic_cast error 1: Both of the following type_info's should have public visibility. At least one of them is hidden. 8wxWindow, 12DatabaseType.

"DatabaseType" is a class I made in order to display the dialog and it is located in one of the dylib's my program uses.

It does have public visibility, though.

My question is - how do I make Xcode run my program successfully, so that I will be able to debug it on Mac?

I am running OSX High Sierra 10.13.6 with Xcode 9.4.1.

(Trying to find the cause I see that this error is found when the programs are running from Terminal. That is not the case here).

Thank you.

What would be the easiest way to ensure only one copy of the dylib is loaded at a run-time? When I inspect the Debug Console window I see that when I run the program from Xcode it loads the dylibs twice - once from the place I compiled the library at and second one from the AppBundle.

Is there a way to ensure only AppBundle copy is being loaded?

And of course it is not the case when I just run the program from the Terminal. Everything runs fine.

Program crashing running from Xcode, but succeeds running from Terminal
 
 
Q