dspatch
dspatch copied to clipboard
[Plugin Load] How do we distinguish between debug and release libraries?
Hello, As the title says, the cause is that when I load the release lib using debug it crashes, and vice versa.
Is there already a way to distinguish between debug and release in this project?
thanks.
Nothing built into DSPatch no. What would you suggest?
Sorry, I don't have a good idea.
But I looked at the Qt source code and it is in a metaData and library binding, the metaData is essentially a json file.
There is a debug item that writes true or false and then determines when the plugin is loaded dynamically.
{qtpath}/Qt/5.15.2/Src/qtbase/src/corelib/plugin/qlibrary.cpp -- 794
uint qt_version = (uint)metaData.value(QLatin1String("version")).toDouble();
bool debug = metaData.value(QLatin1String("debug")).toBool();
...
#ifndef QT_NO_DEBUG_PLUGIN_CHECK
} else if(debug != QLIBRARY_AS_DEBUG) {
//don't issue a qWarning since we will hopefully find a non-debug? --Sam
errorString = QLibrary::tr("The plugin '%1' uses incompatible Qt library."
" (Cannot mix debug and release libraries.)").arg(fileName);
#endif