Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Does Qt libraries expect dynamic linkage？
GingerMoon last edited by
Hi @SGaist and others,
I built a libbitcoin.lib (which was built in vs2017 with the option /MTd). I am able to use the lib in my vs2017 sample project.
However, when I use it in Qt, I got errors below(sorry for the Chinese characters, I would appreciate if anyone can tell me how to generate English errors):
libbitcoin.lib(checkpoint.obj):-1: error: LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MTd_StaticDebug”不匹配值“MDd_DynamicDebug”(main.obj 中)
msvcprtd.lib(MSVCP140D.dll):-1: error: LNK2005: "public: int __thiscall std::ios_base::flags(void)const " (?flags@ios_base@std@@QBEHXZ) 已经在 libbitcoin.lib(checkpoint.obj) 中定义
The author of libbitcoin.lib told me in the github:
"IIRC Qt libraries expect dynamic linkage, which is not currently supported in the libbitcoin VS builds."
Is it true?
I also tried to use the options below in Qt but no luck:
#QMAKE_CFLAGS_DEBUG += -MTd
#QMAKE_CXXFLAGS_DEBUG += -MTd
Also I tried to build the libbitcoin.lib with /MDd, no luck neither.
Any insight would be much appreciated!
You are trying to link two libraries using a different runtime. That's the problem. Either rebuild
libbitcointo use the dynamic runtime or rebuild Qt to use the static runtime.