Hi all,
does somebody has experience handling exceptions within shared libraries on linux?
I can dynamically load my shared library, but if I call a member function in my library which throws exceptions and try to catch it in my main program, I'll get following error:
Program received signal SIGABRT, Aborted.
Terminate called after throwing a instance of 'DBException'.
(In debug mode).
Loading the library in my main app:
typedef DBFactory *create_t();
create_t
*create_object
= (create_t
*)QLibrary::resolve( "./libmylib.so",
"create" );
if( create_object )
{
qDebug() << "Library loaded!!!" << '\n';
dbFac = create_object();
try
{
dbFac->checkConnection(); // in this function the exception will be thrown
// but unfortunately the program crashs
}
catch( DBException &dbEx)
{
...
}
}
typedef DBFactory *create_t();
create_t *create_object = (create_t*)QLibrary::resolve( "./libmylib.so", "create" );
if( create_object )
{
qDebug() << "Library loaded!!!" << '\n';
dbFac = create_object();
try
{
dbFac->checkConnection(); // in this function the exception will be thrown
// but unfortunately the program crashs
}
catch( DBException &dbEx)
{
...
}
}
To copy to clipboard, switch view to plain text mode
Any help would be appreciated.
Best regards
big4mil
Bookmarks