Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Does Qt libraries expect dynamic linkage?
Qt 6.11 is out! See what's new in the release blog

Does Qt libraries expect dynamic linkage?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 673 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GingerMoon
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You are trying to link two libraries using a different runtime. That's the problem. Either rebuild libbitcoin to use the dynamic runtime or rebuild Qt to use the static runtime.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved