Results 1 to 11 of 11

Thread: QPluginLoader instance always returns null

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    May 2016
    Posts
    12
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: QPluginLoader instance always returns null

    Quote Originally Posted by high_flyer View Post
    mixed build mode perhaps? (release/debug)
    No, Both are in debug!
    The thing is, I did something exactly like this before with CMakeList.txt and Visual Studio but its not working with MinGW and QT Creator . I'm missing something but i have no idea what it is !!!


    Added after 18 minutes:


    The following configs of library and plugin in `CMakeList.txt` work perfectly fine when i make the project with `Visual Studio`. (Made with CMake)

    Qt Code:
    1. ADD_DEFINITIONS(${QT_DEFINITIONS})
    2. ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
    3. ADD_DEFINITIONS(-DQT_PLUGIN)
    4. ADD_DEFINITIONS(-DQT_SHARED)
    5. ADD_DEFINITIONS(-DQT_DLL)
    6. ADD_DEFINITIONS(-DQT_LARGEFILE_SUPPORT)
    7. ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
    8.  
    9. INCLUDE_DIRECTORIES(
    10. ${STANDARD_XFS_DIRECTORY}/INCLUDE
    11. )
    12.  
    13. LINK_DIRECTORIES(
    14. ${STANDARD_XFS_DIRECTORY}
    15. ${STANDARD_XFS_DIRECTORY}/LIB
    16. )
    17.  
    18. SET(XFS_LIBS
    19. MSXFS
    20. xfs_conf
    21. SSIDLL
    22. )
    23.  
    24. TARGET_LINK_LIBRARIES(Device-Manager
    25. ${XFS_LIBS}
    26. )
    To copy to clipboard, switch view to plain text mode 

    And this is the configs of library and plugin in `.pro` file in `Qt Creator` with `MinGW` which is not working when i use the library.

    Qt Code:
    1. QT -= gui
    2. QT += core sql
    3.  
    4. TARGET = Device-Manager
    5. TEMPLATE = lib
    6. CONFIG += plugin
    7. CONFIG += c++11
    8.  
    9. DEFINES += DEVICEMANAGER_LIBRARY
    10.  
    11. INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)
    12. INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)/INCLUDE
    13. message(Include : $${INCLUDEPATH})
    14.  
    15. LIBS += $$(STANDARD_XFS_DIRECTORY)/SSIDLL.lib
    16. LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/MSXFS.lib
    17. LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/xfs_conf.lib
    18. message(Lib : $${LIBS})
    To copy to clipboard, switch view to plain text mode 

    So i can say the code it self is fine and i'm definitely missing some configs in `.pro` file.

    PS1: Plugin and the application that load the plugin, Both have `INCLUDEPATH` and `LIBS` of the library in their pro file.

    PS2: The application and the plugin both are in debug mode

    PS3: I dont get any compile error or linker error during compile.
    Last edited by meysam_hashemi; 12th December 2017 at 13:30.

Similar Threads

  1. QSslCertificate returns NULL in Windows Server 2008 R2
    By plopes21 in forum Qt Programming
    Replies: 3
    Last Post: 18th January 2013, 11:24
  2. QImage() returns Null Image
    By ustulation in forum Qt Programming
    Replies: 7
    Last Post: 24th July 2012, 13:52
  3. Replies: 33
    Last Post: 2nd December 2010, 16:47
  4. QDBusMessage returns NULL string
    By nrabara in forum Qt Programming
    Replies: 0
    Last Post: 27th November 2009, 06:09
  5. QPluginLoader instance
    By Jeff100 in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 06:47

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
  •  
Qt is a trademark of The Qt Company.