Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot find how to link to crypt32.dll

Cannot find how to link to crypt32.dll

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 3 Posters 8.6k 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.
  • A Offline
    A Offline
    alexandros
    wrote on last edited by
    #1

    Hello there Qt folks!

    I am trying to use the function CryptProtectData defined and wincrypt.h (see http://msdn.microsoft.com/en-us/library/windows/desktop/aa380261(v=vs.85).aspx) and I need to link against crypt32.dll. And... I don't know how to do it.

    I've found crypt32.dll at C:\Windows\System32\ but that doesn't really help me solve the problem.

    Initially, I asked a question @stackoverflow (http://stackoverflow.com/questions/15614239/undefined-reference-to-imp-cryptprotectdata28) about the error and was told to link against crypt32.dll

    I've programmed quite a bit at Linux where the things (seemed to be, at least) quite simpler, using the PKG_CONFIG and let it find the libraries.

    Any tips on how to link against crypt32 would be grateful :)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      in your .pro file you can add this
      @win32:LIBS += -LC:/Windows/System32 -lcrypt32@

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alexandros
        wrote on last edited by
        #3

        Thanks for your answer mcosta, yes, this fixed the problem, but now I am getting more linking problems, like:
        @error: undefined reference to _imp__SetUnhandledExceptionFilter@4' error: undefined reference to _imp__GetProcAddress@8'@

        I do not directly use these functions so I guess it has to do with chain dependency issues. Anyway, I searched for the functions GetProcAddress() and SetUnhandledExceptionFilter() and they seem to be at kernel32.dll, which is located at C:\Windows\System32 as well.

        Unfortunately, adding
        @win32:LIBS += -LC:/Windows/System32 -lkernel32 -lcrypt32@
        to the .pro file does not seem to solve the problem.

        Any suggestions?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          Hi,

          what compiler are you using? What O.S. WindowsX ?
          I think this is a problem related to crypt32 dependencies.

          I don't know this library but, probably, you must include other DLL's

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexandros
            wrote on last edited by
            #5

            I am using MinGW under Windows 7.

            This is the first time I attempt programming in Windows and that's why I am quite unaware of how you have to link those dlls :/

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              Hi! I think you already know what i'm saying now, however.
              There are 2 ways for linking dlls to app:

              1. Link with *.h, *.lib. in building step you say compiler where is the lib and how to bind it. And get access to library's functions by *.h file.
              2. Load dll directly with "QLibrary":http://qt-project.org/doc/qt-4.8/qlibrary.html
              1 Reply Last reply
              0
              • A Offline
                A Offline
                alexandros
                wrote on last edited by
                #7

                qxoz thanks for the suggestion but I find the complexity of the problem to be more than it should. I am trying to use one of the standard (I mean ... it's there) dlls (the wincrypt.h one) along with windows.h.

                This is standard stuff, a simple linking rule should clear things out. How did the ones programming in windows used these libraries before?

                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