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 Cryptlib Library with Qt creator
Forum Updated to NodeBB v4.3 + New Features

Link Cryptlib Library with Qt creator

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.2k 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.
  • S Offline
    S Offline
    sikander243
    wrote on 17 Feb 2013, 12:04 last edited by
    #1

    I have Qt Creator 2.6.1 based on Qt 5.0 I have build cryptlib with visual studio 2010

    all cryptlib project is on C:\SDK\cl342 when I have built the project the crypt.h and cl32.lib and cl32.dll are in this folder C:\SDK\cl342

    I am getting linker error on every method that I call from cryptlib such as cryptInit I have tried adding it from the project menu and add external library it makes many changes to pro file but does not even let me include crypt.h.

    mainwindow.obj:-1: error: LNK2019: unresolved external symbol _cryptEnd@0 referenced in function "public: __thiscall MainWindow::MainWindow(class QWidget *)" (??0MainWindow@@QAE@PAVQWidget@@@Z) –

    my pro files looks something like this.

    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = testlistview
    TEMPLATE = app
    SOURCES += main.cpp
    mainwindow.cpp
    HEADERS += mainwindow.h
    FORMS += mainwindow.ui
    INCLUDEPATH = C:\SDK\cl342
    DEPENDPATH += C:\SDK\cl342
    LIBS += C:\SDK\cl342\cl32.lib

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hostel
      wrote on 17 Feb 2013, 19:43 last edited by
      #2

      Maybe try:
      @
      INCLUDEPATH += C:\SDK\cl342\ #add a + sign
      LIBS += -LC:\SDK\cl342\cl32.lib -lcl32

      else looks ok

      @

      1 Reply Last reply
      0
      • C Offline
        C Offline
        ChrisW67
        wrote on 17 Feb 2013, 22:36 last edited by
        #3

        That would be:
        @
        LIBS += -LC:/SDK/cl342 -lcl32

        or

        LIBS += C:/SDK/cl342/cl32.lib
        @

        (Get out of the habit of using backslashes in pro files and you will avoid the qmake warnings about unescaped backslashes)

        Are you sure of the library name? cl32 not cl342 perhaps?
        Is the project being built with the same compiler you used for the library? If not you might have a binary format mismatch issue: MSVC++ lib files are not useful in MingW builds.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sikander243
          wrote on 18 Feb 2013, 07:14 last edited by
          #4

          well either of the above didn't work I still get the same error.
          I made sure the lib and the dll names are cl32.lib, cl32.dll

          more over I found out there is another folder there
          C:\SDK\cl342\binaries32_vs10
          and here I found the libs with same name as well and tried to access them the above mentioned way.

          I am not doing any thing with the MingW I guess, I built cryptlib with Visual Studio and settings in Qt Creator for my test project are
          qmake.exe C:\Qt\Qt5.0.0\Tools\QtCreator\bin\testlistview\testlistview.pro -r -spec win32-msvc2010

          more over I have a strange issue that if try compiling my Qt application in Debug it gives me crypt.h not found error
          error: C1083: Cannot open include file: 'crypt.h': No such file or directory
          at the same time when I switch to debug it gives me no header error but if I switch to release configuration I get this linker error.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sikander243
            wrote on 18 Feb 2013, 07:19 last edited by
            #5

            I tried using the right click and Add-library option as well that wrote the following lines in my .pro file
            more over built cryptlib to be a static lib

            unix|win32: LIBS += -L$$PWD/../../../../../../SDK/cl342/binaries32_vs10/ -lcl32

            INCLUDEPATH += $$PWD/../../../../../../SDK/cl342
            DEPENDPATH += $$PWD/../../../../../../SDK/cl342

            win32: PRE_TARGETDEPS += $$PWD/../../../../../../SDK/cl342/binaries32_vs10/cl32.lib
            else:unix: PRE_TARGETDEPS += $$PWD/../../../../../../SDK/cl342/binaries32_vs10/libcl32.a

            but to no use the error is still same

            1 Reply Last reply
            0

            1/5

            17 Feb 2013, 12:04

            • Login

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