Results 1 to 4 of 4

Thread: QPluginLoader not recognizing a plugin

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: QPluginLoader not recognizing a plugin

    Quote Originally Posted by fullmetalcoder View Post
    So many things... :P But let's start with the most obvious one : unresolved symbols... When you build a shared library (and plugins are shared libraries) you must export some symbols... The thing, which already happened to me, is that when a method is declared but NOT defined within the plugin it can result in a "symbol lookup error" when QPluginLoader (through QLibrary actually) tries to load the plugin. This prevent the plugin instance to be created... To make sure this is not happening (or when it happens to locate the troublesome function) all you need is to create a simple test app with just a empty main() function and which LINKS to the plugin (it does not load it on run-time!!! it LINKS so you got to add the plugin to LIBS variable). This way all missing symbols should be notified when linking the test app and you'll see what to fix
    Wow... you were right. The problems (there were a few missing symbols) were not anywhere in those sections, but in an entirely different area... and I would never have seen it without making that simple app. Thanks!

    Heh, that's the way I really prefer to get answers - teach me to fish rather than give me a fish - now I can handle this sort of problem at any time. That's incredibly valuable .
    Life without passion is death in disguise

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPluginLoader not recognizing a plugin

    Quote Originally Posted by KShots View Post
    Wow... you were right. The problems (there were a few missing symbols) were not anywhere in those sections, but in an entirely different area... and I would never have seen it without making that simple app. Thanks!
    I've been playing with plugins since about a year now and it took me a while to think about this trick so I thought it would be worth sharing it Good to see that it helped you.

    Quote Originally Posted by KShots View Post
    Heh, that's the way I really prefer to get answers - teach me to fish rather than give me a fish - now I can handle this sort of problem at any time. That's incredibly valuable .
    That's the point of a forum : sharing knowledge after having experienced several aspects of programming. We look like old soldiers sharing little tricks on how to survive on a battlefield
    Current Qt projects : QCodeEdit, RotiDeCode

Similar Threads

  1. plugin loading problem
    By naresh in forum Qt Programming
    Replies: 6
    Last Post: 9th June 2007, 19:05
  2. Qt4 win opensource + mysql plugin
    By vr in forum Installation and Deployment
    Replies: 3
    Last Post: 25th May 2007, 09:01
  3. QPluginLoader Qt 4
    By rianquinn in forum Qt Programming
    Replies: 9
    Last Post: 2nd October 2006, 07:04

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.