Results 1 to 3 of 3

Thread: exception in shared libraries

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    19
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default exception in shared libraries

    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:
    Qt Code:
    1. typedef DBFactory *create_t();
    2. create_t *create_object = (create_t*)QLibrary::resolve( "./libmylib.so", "create" );
    3.  
    4. if( create_object )
    5. {
    6. qDebug() << "Library loaded!!!" << '\n';
    7. dbFac = create_object();
    8. try
    9. {
    10. dbFac->checkConnection(); // in this function the exception will be thrown
    11. // but unfortunately the program crashs
    12. }
    13. catch( DBException &dbEx)
    14. {
    15. ...
    16. }
    17. }
    To copy to clipboard, switch view to plain text mode 

    Any help would be appreciated.
    Best regards
    big4mil
    Last edited by big4mil; 4th December 2006 at 23:30.

Similar Threads

  1. shared library problem
    By nhatkhang in forum KDE Forum
    Replies: 9
    Last Post: 28th November 2006, 04:07
  2. Shared lib template broken under linux ???
    By fullmetalcoder in forum Qt Programming
    Replies: 9
    Last Post: 26th April 2006, 20:05
  3. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52
  4. Replies: 4
    Last Post: 7th March 2006, 08:52
  5. Exceptions and qApp->processEvents()
    By mcostalba in forum Qt Programming
    Replies: 3
    Last Post: 8th January 2006, 17:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.