Results 1 to 12 of 12

Thread: .lib is not a valid Qt plugin

  1. #1
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default .lib is not a valid Qt plugin

    Hi,

    I'm having trouble trying to get my app to work. I use .dll plugins on windows vesrion of my app. I compiled the plugins with .lib and .dll extensions to see which one works on winCE.

    None worked, with the dll failing and the .olib showing "not a valid qt plugin" message.

    what am I missing?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: .lib is not a valid Qt plugin

    It's not possible to answer your question with so little information given.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: .lib is not a valid Qt plugin

    Qt Code:
    1. #if defined(Q_WS_WINCE)
    2. fileName += ".lib";
    3. #endif
    4.  
    5. const QString pluginFileName(pluginsDir.absoluteFilePath(fileName));
    6. QPluginLoader loader(pluginFileName);
    7.  
    8. QObject *plugin = loader.instance();
    9. if (plugin) {
    10. if(qobject_cast<BasicStudentInterface *>(plugin))
    11. {
    12. instantiateBasicStudentPlugin(plugin);
    13. }
    14. else if(qobject_cast<IStudentMessenger *>(plugin))
    15. {
    16. instantiateStudentMessengerPlugin(plugin);
    17. }
    18. ...
    19. }
    To copy to clipboard, switch view to plain text mode 

    on my code when I try to read fileName += ".lib" plugin it says that "the file plugin.lib is not a valid Qt plugin".

    Then I go to my plugin project's properties and change the configuration type to .dll and fileName += ".dll"... recompile all and try to run with dll an error message says that "could not load shared library".

    Is there any especific configuration for plugins to work? do they need to be .lib or .dll?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: .lib is not a valid Qt plugin

    I'd start with Dependency Walker.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    rickrvo (19th May 2011)

  6. #5
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: .lib is not a valid Qt plugin

    I don't know what I did now I can't make the .dll file... It compiles perfectly with .lib and when I change the configuration type to .dll it appears 600 linking errors...

    How may I use the dependencies walker? the 1.0 version for wince under a wince emulator? or the windows version on the .dll file since it doesn't read .lib files...?

    I can't compile a new dll file now... but the dependency walker on the previous .dll says that Qtgui4.dll, qtnetwork4.dll, qtcore4.dll, coredll.dll and msvc90.dll are missing...

    Where do I add this dependencies? I'm not very good with visual studio...

  7. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: .lib is not a valid Qt plugin

    lib files are only required during compilation and not run-time. For the latter you need dll files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    rickrvo (19th May 2011)

  9. #7
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: .lib is not a valid Qt plugin

    how do I add the dependencies for the compilation then?

  10. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: .lib is not a valid Qt plugin

    I don't understand your question.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #9
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: .lib is not a valid Qt plugin

    I've managed to make a new dll (had to remove the current project and open .pro file again)

    now dependency walker says this:
    Qt Code:
    1. Module File Time Stamp Link Time Stamp File Size Attr. Link Checksum Real Checksum CPU Subsystem Symbols Preferred Base Actual Base Virtual Size Load Order File Ver Product Ver Image Ver Linker Ver OS Ver Subsystem Ver
    2. ----- ------------------ ---------------- ---------------- --------- ----- ------------- ------------- ----- -------------- ------- -------------- ----------- ------------ ---------- -------- ----------- --------- ---------- ------ -------------
    3. [ ? ] COREDLL.DLL Error opening file. The system cannot find the file specified (2).
    4. [ ? ] MSVCR90.DLL Error opening file. The system cannot find the file specified (2).
    5. [ ? ] QTCORE4.DLL Error opening file. The system cannot find the file specified (2).
    6. [ ? ] QTGUI4.DLL Error opening file. The system cannot find the file specified (2).
    7. [ ? ] QTNETWORK4.DLL Error opening file. The system cannot find the file specified (2).
    8. [ ] CALLLISTCLIENT.DLL 19-05-2011 14:59 19-05-2011 14:59 108.544 A 0x00000000 0x0002784F Thumb WinCE 2.0+ GUI None 0x10000000 Unknown 0x0001E000 Not Loaded N/A N/A 0.0 9.0 5.2 5.2
    To copy to clipboard, switch view to plain text mode 

    these missing dll's are on the app's folder in order for the mainwindow to work. and the dll is on "plugins" folder.

    My question was what do I have to do to build a compatible plugin for my application?

  12. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: .lib is not a valid Qt plugin

    First you need to find out what is wrong with the plugin. If the missing libraries are present in the application directory then apparently the problem is related to something else. Make sure the paths are correct and the file exists and is readable before loading the plugin.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. The following user says thank you to wysota for this useful post:

    rickrvo (19th May 2011)

  14. #11
    Join Date
    Dec 2010
    Posts
    71
    Thanks
    26
    Platforms
    Windows

    Default Re: .lib is not a valid Qt plugin

    fixed it! Don't know how but I did! lol I think was something that i've changed in the .pro file before reloading it to visual studio.

    Thanks

  15. #12
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: .lib is not a valid Qt plugin

    Is the lib constructed as a Qt plugin???

    http://doc.qt.nokia.com/4.7/plugins-howto.html

Similar Threads

  1. No valid Qt version set?
    By RoryWalsh in forum Qt Tools
    Replies: 4
    Last Post: 21st October 2009, 09:02
  2. What constitutes valid Qt folder?
    By piotr.dobrogost in forum Installation and Deployment
    Replies: 22
    Last Post: 26th July 2009, 04:41
  3. Why can I not generate a valid Time_t?
    By philwinder in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2009, 17:19
  4. QGLWidget::isValid() not valid in Qt-4.3.2?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2008, 23:14
  5. valid a path name
    By klaus1111 in forum Newbie
    Replies: 3
    Last Post: 23rd July 2006, 16:07

Tags for this Thread

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.