Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I want to link some static .libs with my QT Creator project

I want to link some static .libs with my QT Creator project

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.5k 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.
  • P Offline
    P Offline
    pranavj95
    wrote on last edited by
    #1

    I have tried using QMAKE_CXXFLAGS_DEBUG flag but I still get this error in QT :-

     qtmaind.lib(qtmain_win.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in main.obj
    
    K 1 Reply Last reply
    0
    • P pranavj95

      I have tried using QMAKE_CXXFLAGS_DEBUG flag but I still get this error in QT :-

       qtmaind.lib(qtmain_win.obj):-1: error: LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in main.obj
      
      K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      @pranavj95

      Hi and welcome to devnet forum

      You need to give more details on OS and compiler versions.
      Also details of the actual static library you like to link (e.g. possible special compilation flags for the static library).

      Vote the answer(s) that helped you to solve your issue(s)

      P 2 Replies Last reply
      0
      • P Offline
        P Offline
        pranavj95
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • K koahnig

          @pranavj95

          Hi and welcome to devnet forum

          You need to give more details on OS and compiler versions.
          Also details of the actual static library you like to link (e.g. possible special compilation flags for the static library).

          P Offline
          P Offline
          pranavj95
          wrote on last edited by
          #4

          @koahnig thanks for the warm welcome.

          I am using Win 10 with QT 5.10
          It is a custom made static library on Visual Studio. There aren't any special compilation flags which I am using to build the static library.

          1 Reply Last reply
          0
          • K koahnig

            @pranavj95

            Hi and welcome to devnet forum

            You need to give more details on OS and compiler versions.
            Also details of the actual static library you like to link (e.g. possible special compilation flags for the static library).

            P Offline
            P Offline
            pranavj95
            wrote on last edited by
            #5

            @koahnig Correction : I am using Visual C++ 2015 Compiler

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

              Hi and welcome to devnet,

              From the looks of it your custom library is linked against the static Visual Studio runtime so it clashes with Qt that is built agains the dynamic runtime.

              To make thing simple, link your static libraries to the dynamic runtime and you should be good to go.

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

              P 1 Reply Last reply
              0
              • SGaistS SGaist

                Hi and welcome to devnet,

                From the looks of it your custom library is linked against the static Visual Studio runtime so it clashes with Qt that is built agains the dynamic runtime.

                To make thing simple, link your static libraries to the dynamic runtime and you should be good to go.

                P Offline
                P Offline
                pranavj95
                wrote on last edited by
                #7

                @SGaist Could you tell me more about how to do that? I just got .lib files for the libraries.

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

                  Do you mean change the runtime type selection when building your custom libraries in Visual Studio ?

                  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

                  • Login

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