Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. _ITERATOR_DEBUG_LEVEL error for libraries
Forum Updated to NodeBB v4.3 + New Features

_ITERATOR_DEBUG_LEVEL error for libraries

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 2 Posters 4.1k Views 1 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.
  • N Offline
    N Offline
    Nelson_Piquet
    wrote on last edited by
    #1

    I am having a Qt app with a few C++ libraries all built using Qmake & QtCreator on windows. I am using VisualStudio 2015 community edition which provides the C++ compiler to Qt on windows. By selecting debug option in bottom left corner, I generated debug libs out of all my library projects. But when I build my app in debug mode now, it results in following error.
    LNK2038:mismatch detected for _ITERATOR_DEBUG_LEVEL value 0 doesnt match value 2 in main.obj

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

      IIRC you can use TARGET = $$qtLibraryTarget(MyLib)

      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
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        AFAIK, it comes when you are mixing objects built for different type of builds. Did you clean everything before changing the build type ?

        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
        0
        • N Offline
          N Offline
          Nelson_Piquet
          wrote on last edited by
          #3

          Yes I did. really strange. i just need the debug libs ONLY on windows so I am linking them on myapp.pro like this

          LIBS += -L$$MyLib_build_location -lMyLib
          Debug:win32: LIBS += -L$$MyLib_build_location -lMyLibD
          INCLUDEPATH += $$MyLib_include_location/
          DEPENDPATH += $$MyLib_include_location/
          unix:PRE_TARGETDEPS += $$MyLib_build_location/MyLib.a
          win32:PRE_TARGETDEPS += $$MyLib_build_location/MyLib.lib

          Is above not correct ? Can you pls provide a sample ?

          1 Reply Last reply
          0
          • N Offline
            N Offline
            Nelson_Piquet
            wrote on last edited by
            #4

            @SGaist Qt is not appending a D to the debug version of of lib. It names MyLib.lib even in debug version whereas I am expecting it to be MyLibD.lib. In pro file of my MyLib I have defined the following

            TARGET = MyLib

            Is it because of above line of code in MyLib.lib. Is there some way I can ensure that debug version of my lib gets a name with D appended to it ?

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

              IIRC you can use TARGET = $$qtLibraryTarget(MyLib)

              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
              • N Offline
                N Offline
                Nelson_Piquet
                wrote on last edited by
                #6

                @SGaist Thanks a lot. That solves my problem.

                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