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. cryptlib.lib error: LNK2038: mismatch detected for 'RuntimeLibrary'
Forum Updated to NodeBB v4.3 + New Features

cryptlib.lib error: LNK2038: mismatch detected for 'RuntimeLibrary'

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.0k 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.
  • gmk27G Offline
    gmk27G Offline
    gmk27
    wrote on last edited by gmk27
    #1

    Hi, I want to use cryptopp v8.5 for AES encryption in my project.
    I built the cryptlib.lib files from source files in MSVC2019. And it was successful.
    I have added the same to the project by adding below lines in .pro file.

    CONFIG(debug,debug|release){
        LIBS += ../Win32/Output/Debug/cryptlib.lib
    }else{
        LIBS += ../Win32/Output/Release/cryptlib.lib
    }
    

    Included the paths too where Crypto folder contains all the header files-

    INCLUDEPATH += ../Crypto
    

    I'm running into handful of linking errors

    ea5deea0-e6c6-4dae-99fe-f0855d23d8aa-image.png

    Tried lot of solutions but not fixed still. My VS RTL setting looks like this for DEBUG-

    3ba0d1bc-52a8-4e75-aa3a-1126d3ff2fac-image.png

    And for RELEASE -

    83940ad1-6c75-482f-baa8-70b5013c48d9-image.png

    Where do I make changes to properly compile? in VS or Qt?
    I tried multiple combinations in VS project settings already with MTd, MT, MDd, MD.
    Thanks.

    Free softwares drives technology.

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

      Hi,

      Since you are building cryptopp in Visual Studio, the changes should be done there.

      The correct values are the MD ones.

      Are you sure the output path of the build stays the same ?

      In any case, if changing the runtime linked does not change the build output of your application, I would nuke the output folder of the cryptopp build to ensure the libraries are generated again.

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

      gmk27G 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        Since you are building cryptopp in Visual Studio, the changes should be done there.

        The correct values are the MD ones.

        Are you sure the output path of the build stays the same ?

        In any case, if changing the runtime linked does not change the build output of your application, I would nuke the output folder of the cryptopp build to ensure the libraries are generated again.

        gmk27G Offline
        gmk27G Offline
        gmk27
        wrote on last edited by
        #3

        @SGaist That worked.
        But MD ones are usually for dynamic linkage and for generating dlls, then how come it has generated lib files? Are all lib files not static?! (referring to error LNK2038 above)
        Please clarify. Thanks.

        Free softwares drives technology.

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

          MD/MT is unrelated to the type of libraries you are building, they are related to the runtime used by your library/application. A static library can have dynamic dependencies.

          As for .lib files, they are both for static libraries as well as import libraries. The import libraries is usually small and will only contain the information required to link the library and you will need the .dll at runtime. Unless you have a really small library, the usual way to check which version it is is the size of the .lib file.

          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