
Originally Posted by
high_flyer
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)
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_DEFINITIONS(-DQT_DLL)
ADD_DEFINITIONS(-DQT_LARGEFILE_SUPPORT)
ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
INCLUDE_DIRECTORIES(
${STANDARD_XFS_DIRECTORY}/INCLUDE
)
LINK_DIRECTORIES(
${STANDARD_XFS_DIRECTORY}
${STANDARD_XFS_DIRECTORY}/LIB
)
SET(XFS_LIBS
MSXFS
xfs_conf
SSIDLL
)
TARGET_LINK_LIBRARIES(Device-Manager
${XFS_LIBS}
)
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_DEFINITIONS(-DQT_DLL)
ADD_DEFINITIONS(-DQT_LARGEFILE_SUPPORT)
ADD_DEFINITIONS(-DQT_THREAD_SUPPORT)
INCLUDE_DIRECTORIES(
${STANDARD_XFS_DIRECTORY}/INCLUDE
)
LINK_DIRECTORIES(
${STANDARD_XFS_DIRECTORY}
${STANDARD_XFS_DIRECTORY}/LIB
)
SET(XFS_LIBS
MSXFS
xfs_conf
SSIDLL
)
TARGET_LINK_LIBRARIES(Device-Manager
${XFS_LIBS}
)
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 -= gui
QT += core sql
TARGET = Device-Manager
TEMPLATE = lib
CONFIG += plugin
CONFIG += c++11
DEFINES += DEVICEMANAGER_LIBRARY
INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)
INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)/INCLUDE
message(Include : $${INCLUDEPATH})
LIBS += $$(STANDARD_XFS_DIRECTORY)/SSIDLL.lib
LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/MSXFS.lib
LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/xfs_conf.lib
message(Lib : $${LIBS})
QT -= gui
QT += core sql
TARGET = Device-Manager
TEMPLATE = lib
CONFIG += plugin
CONFIG += c++11
DEFINES += DEVICEMANAGER_LIBRARY
INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)
INCLUDEPATH += $$(STANDARD_XFS_DIRECTORY)/INCLUDE
message(Include : $${INCLUDEPATH})
LIBS += $$(STANDARD_XFS_DIRECTORY)/SSIDLL.lib
LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/MSXFS.lib
LIBS += $$(STANDARD_XFS_DIRECTORY)/LIB/xfs_conf.lib
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.
Bookmarks