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. QtCreator cmake release build seems to be using debug libraries

QtCreator cmake release build seems to be using debug libraries

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 1 Posters 483 Views
  • 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.
  • C Offline
    C Offline
    ChortleMortal
    wrote on last edited by ChortleMortal
    #1

    I have converted a qmake build to a cmake build. The debug build seems fine. But when using QrCreator I switch to the Release build, it compiles but does not link with numerous errors. Below is just the first instance of the errors. Seems like it is using Qt6Cored.lib rather than Qt6Core.lib. I would have thought that QtCreator would handle all this, but is there something that needs to be put into the CMakeLists.txt to say which libraries to use for release and debug. I would have thought the Qt Kit handled all that.

    LINK: command "C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\bin\Hostx64\x64\link.exe /nologo @CMakeFiles\TiledPatternMaker.rsp /out:TiledPatternMaker.exe /implib:TiledPatternMaker.lib /pdb:TiledPatternMaker.pdb /version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console -DYNAMICBASE -NXCOMPAT -OPT:REF -OPT:ICF /MANIFEST /MANIFESTFILE:TiledPatternMaker.exe.manifest" failed (exit code 1120) with the following output:
    Qt6Cored.lib(qmetaobject.cpp.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in mocs_compilation.cpp.obj
    Qt6Cored.lib(qmetaobject.cpp.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MD_DynamicRelease' in mocs_compilation.cpp.obj

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChortleMortal
      wrote on last edited by
      #2

      Well I made two changes and don't know which one fixed it. But in case someone else has this problem, this is what I did.

      First, I downloaded and started using QtCreator 4.15.0-beta 2 since it has lots of changes related to cmake.

      Second, I added a call to qt_finalize_executable() it to my CmakeLists.tx().

      So now, all the builds work

      1 Reply Last reply
      0

      • Login

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