2

I'm trying to compile my program with Visual Studio 2013 C++,

I have no errors until I compile.

error LNK2001: unresolved external symbol _EVP_DecryptUpdate
error LNK2001: unresolved external symbol _EVP_DecryptInit
error LNK2001: unresolved external symbol _EVP_DecryptFinal
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_new
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_init
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_free
error LNK2001: unresolved external symbol _EVP_CIPHER_CTX_cleanup
error LNK2001: unresolved external symbol _EVP_aes_128_cbc

I'm using stock OpenSSL Libraries. I've successfully linked them to the openssl folder.

How do I resolve this issue?

Niall
  • 30,036
  • 10
  • 99
  • 142
Gabriel Fraser
  • 153
  • 1
  • 1
  • 10
  • 1
    I don't think it's a duplicate.I just need some assistance as I'm lost and I don't know what to do.. :l – Gabriel Fraser Jul 27 '15 at 06:59
  • That question has numerous detailed answers as to the multiple sources of this type of error (missing symbols). I think the help I can offer is to work through every answer - it is tedious but that goes part in parcel with the problem you have. – Niall Jul 27 '15 at 07:03
  • Have you ever linked with an external library using VS 2013 C++ before? In other words is this some unusual problem and you know what you are doing, or are you just looking for someone to explain how to do linking with VS 2013 C++? – john Jul 27 '15 at 07:03
  • The file was given to me by a friend. He gave me instructions and I've followed, I don't want to damage the file. But I'll try things and get back to you. – Gabriel Fraser Jul 27 '15 at 07:04
  • @john I know how to link a library, and I've done that. – Gabriel Fraser Jul 27 '15 at 07:04
  • I cant think of anything you could do that would damage the file. What you should do is say what the instructions you followed are. Anyone trying to help is a bit in the dark at the moment. – john Jul 27 '15 at 07:07
  • Look at [How to use OpenSSL with Visual Studio](http://stackoverflow.com/questions/11383942/how-to-use-openssl-with-visual-studio) – markshancock Jul 27 '15 at 07:08
  • I'm trying everything you guys are doing. – Gabriel Fraser Jul 27 '15 at 07:09
  • Did your friend build them in 32 or 64 bit mode, are you building in the same mode? – Niall Jul 27 '15 at 07:13
  • 32 bit, how do I check? – Gabriel Fraser Jul 27 '15 at 07:14
  • 1
    Put the linker into verbose mode `/VERBOSE:Lib` and inspect the search path. You'll note that it's missing the openssl lib. – Andy Brown Jul 27 '15 at 07:57

1 Answers1

11

Taken from: using OpenSSL in Visual Studio 2012

UPDATE

This question helped me also in finding the solution. Boost SSL with Visual Studio 2010 and OpenSSL

The steps required to use the openSSL lib with VS2012:

  • download and install a version (I have 64bit OS, however I installed 32bit openssl) from http://slproweb.com/products/Win32OpenSSL.html.
  • New project in VS, then Configuration Properties/C/C++/General/Additional Include Directories: openssl include folder (C:\OpenSSL-Win32\include)
  • Linker/General/Additional Library Directiories: C:\OpenSSL-Win32\lib
  • Linker/Input/Additional Dependencies :
  • libeay32.lib libeay32MTd.lib libeay32MT.lib libeay32MDd.lib libeay32MD.lib ssleay32.lib ssleay32MTd.lib ssleay32MT.lib ssleay32MDd.lib ssleay32MD.lib

(It was written that I need to only add that one which matches with C/C++/Code Generation/Runtime Library, but It works me this way.)

Copy theese files into current VS folder /VC/lib

This is what helped me

Community
  • 1
  • 1
Gabriel Fraser
  • 153
  • 1
  • 1
  • 10