Hi All,
I have migrated from QT 4.7 to QT 5.1. I have a code for compiling a .dll file for a plugin in my software. The .pro file is here.
DccSrc = ../../
include($$DccSrc"DccGlobals.pri")
TEMPLATE = lib
CommonPath = $$DccSrc"Common"
DEPENDPATH += . Interface $$CommonPath
DLLDESTDIR = $$DCC_BIN/plugins
DEFINES += MTF_LIBRARY
DEFINES += QT __LCC__
SOURCES += MTF.cpp \
LibTI_MTF.c \
LibTI_MTF_mcc_component_data.c
HEADERS += MTF.h \
LibTI_MTF.h \
../../../Common/ctypes.h
INCLUDEPATH += . $$CommonPath ../../MatLabHFilesForQT "C:\Program Files\MATLAB\MATLAB Compiler Runtime\v713\extern\include"
LIBS += -L"C:/Program Files/MATLAB/MATLAB Compiler Runtime/v713/extern/lib/win32/microsoft" -lmclmcrrt
DccSrc = ../../
include($$DccSrc"DccGlobals.pri")
TEMPLATE = lib
CommonPath = $$DccSrc"Common"
DEPENDPATH += . Interface $$CommonPath
DLLDESTDIR = $$DCC_BIN/plugins
DEFINES += MTF_LIBRARY
DEFINES += QT __LCC__
SOURCES += MTF.cpp \
LibTI_MTF.c \
LibTI_MTF_mcc_component_data.c
HEADERS += MTF.h \
LibTI_MTF.h \
../../../Common/ctypes.h
INCLUDEPATH += . $$CommonPath ../../MatLabHFilesForQT "C:\Program Files\MATLAB\MATLAB Compiler Runtime\v713\extern\include"
LIBS += -L"C:/Program Files/MATLAB/MATLAB Compiler Runtime/v713/extern/lib/win32/microsoft" -lmclmcrrt
To copy to clipboard, switch view to plain text mode
It gets compiled in QT 4.7.3. But in QT 5 it is not able to find the symbols for MCR library functions.
D:\QT\DCC_TuningTool\plugins\MTF\MTF.cpp:50: error: undefined reference to `mxCreateDoubleScalar_proxy(double)'
D:\QT\DCC_TuningTool\plugins\MTF\MTF.cpp:51: error: undefined reference to `mxCreateDoubleScalar_proxy(double)'
D:\QT\DCC_TuningTool\plugins\MTF\MTF.cpp:52: error: undefined reference to `mxCreateDoubleScalar_proxy(double)'
D:\QT\DCC_TuningTool\plugins\MTF\MTF.cpp:55: error: undefined reference to `mxCreateString_proxy(char const*)'
and so on..
all these symbols exist on mclmcrrt.lib
If I do a static linking
DEFINE += static
DEFINE += static
To copy to clipboard, switch view to plain text mode
it gets compiled. But I need dynamic linking for this plug in.
I have other plug-ins, where I don't have the any CPP source file, there static/dynamic both linking works.
Bookmarks