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. Link library MSVC
Qt 6.11 is out! See what's new in the release blog

Link library MSVC

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

    My project compiles with MinGW 5.3 and Qt 5.7.0. However, with MSVC 2015 32 bit I get unresolved external symbol for CryptAcquireContextW and RegCloseKey. I found that libraries needed are advapi32 and crypt32.

    I don't have to specify these libraries explicitly in *.pro file for MinGW but it seems MSVC needs it. How to modify *.pro file so it compiles for both MinGW and MSVC?

    I already tried to add LIBS += -ladvapi32 -lcrypt32 but that doesn't work for MSVC compilation - I still get unresolved external symbols.

    Ni.SumiN 1 Reply Last reply
    0
    • M MartinD

      My project compiles with MinGW 5.3 and Qt 5.7.0. However, with MSVC 2015 32 bit I get unresolved external symbol for CryptAcquireContextW and RegCloseKey. I found that libraries needed are advapi32 and crypt32.

      I don't have to specify these libraries explicitly in *.pro file for MinGW but it seems MSVC needs it. How to modify *.pro file so it compiles for both MinGW and MSVC?

      I already tried to add LIBS += -ladvapi32 -lcrypt32 but that doesn't work for MSVC compilation - I still get unresolved external symbols.

      Ni.SumiN Offline
      Ni.SumiN Offline
      Ni.Sumi
      wrote on last edited by Ni.Sumi
      #2

      @MartinD
      Add them as additional libraries to your project and try it.

      Check this , for adding additional libs in MSVC

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MartinD
        wrote on last edited by
        #3

        I'm sorry, I should have mentioned that I use Qt Creator, not Visual Studio.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          LIBS += -ladvapi32 -lcrypt32 is enough. Make sure you re-run qmake after you edited the .pro file (Build - > Run qmake).

          1 Reply Last reply
          3
          • M Offline
            M Offline
            MartinD
            wrote on last edited by
            #5

            Thank you. Re-run of qmake fixed it.

            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