Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. OpenSSL undefined references
Forum Updated to NodeBB v4.3 + New Features

OpenSSL undefined references

Scheduled Pinned Locked Moved 3rd Party Software
2 Posts 2 Posters 4.8k 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.
  • H Offline
    H Offline
    House15
    wrote on last edited by
    #1

    Good day, everyone.

    I have some trouble with EVP functions from OpenSSL libraries. The file evp.h was included in project, by:
    "#include <C:\OpenSSL-Win64\include\openssl\evp.h>" and only it was included i project. Nothing more.

    Qt still tells me about "undefined references", something like that:
    @C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-MinGW_4_4__Qt_SDK________/../Server/myserver.cpp:141: undefined reference to EVP_CIPHER_CTX_init' C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK_________/../Server/myserver.cpp:144: undefined reference to EVP_aes_256_cfb1'
    C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-MinGW_4_4__Qt_SDK________/../Server/myserver.cpp:147: undefined reference to EVP_EncryptInit' C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK_________/../Server/myserver.cpp:141: undefined reference to EVP_CIPHER_CTX_init'
    C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-MinGW_4_4__Qt_SDK________/../Server/myserver.cpp:144: undefined reference to EVP_aes_256_cfb1' C:\Users\House15\Documents\QtProjects\Server-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK_________/../Server/myserver.cpp:147: undefined reference to EVP_EncryptInit'@

    Installing the libraries was held step by step:

    1. File C:\Qt\4.7.4\mkspecs\win32-g++\qmake.conf

    @QMAKE_CFLAGS_RELEASE = -O2 -MD@ was changed to @QMAKE_CFLAGS_RELEASE = -O2 -MT@
    @QMAKE_CFLAGS_DEBUG = -Zi -MDd@ was changed to @QMAKE_CFLAGS_DEBUG = -Zi -MTd@

    1. File C:\Qt\4.7.4\mkspecs\win32-g++\qmake.conf
      @CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files
      debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe@
      was changed to:
      @ CONFIG += qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files
      debug_and_release debug_and_release_target@

    3.From Makefile deleting all strings, contains "example" and "demos", just for increasing speed of compilation.
    4. Using Visual studio 2010 command promt, in directory C:\Qt\4.7.4 write this:
    @configure.exe -static -release -qt-zlib -qt-gif -qt-libpng -qt-libmng -qt-libjpeg -no-crt -openssl -I C:\OpenSSL-Win64\include -L C:\OpenSSL-Win64\lib\VC -qt-sql-odbc -no-webkit@

    5.nmake.

    6.On error reports about unable libraries <openssl/...>, i react simple:
    changed @# include <openssl / ... @ on the @# include <d :/ src/3rd-party/openssl/include / ...,@ ie, the directory in which I lay these same header files.

    7.Errors which tell us about undefined libraries libeay32MT.lib and ssleay32MT.lib, fixin by renaming libs into libeay32.lib, and ssleay32.lib correspondingly, and put them into C:\Qt\4.7.4\lib. Type "nmake" again.

    8.nmake install.

    I guess, it was a mistake, using Visual Studio, instead MinGW, but when i tried to compile files with MinGW, system says what it's cannot define files like "stdlib.h" and "stdio.h". I just don't khow where this files must lies in MinGW.

    In "PATH" declared only "C:\Qt\4.7.4\bin". I have read, it's enough in a most cases.

    Also heard about LIBS+=-lcrypto, but in .conf file of the project it's exactly unnecessary. Where it must be?

    My .pro file:
    @QT += core gui network sql
    CONFIG+= qaxcontainer crypto

    TARGET = Server
    TEMPLATE = app

    #LIBS+=-lcrypto

    Input

    HEADERS += dialog.h
    myclient.h
    myserver.h
    myclient.h
    myserver.h \

    FORMS += dialog.ui
    SOURCES += dialog.cpp main.cpp myclient.cpp myserver.cpp
    @
    Many thanks in advance.

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VanDerSam
      wrote on last edited by
      #2

      What kind of Qt distribution do you use? (VS or MinGW). For example, if you use MinGW version of Qt you must have MinGW version of OpenSSL.

      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