I am getting below error while migrating my project from VS2008 to VS2015.
21>TFCLd.lib(cryptlib.obj) : warning LNK4217: locally defined symbol _fprintf imported in function _OpenSSLDie
21>TFCLd.lib(rsa_sign.obj) : warning LNK4049: locally defined symbol _fprintf imported
21>TFCLd.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __imp____iob_func referenced in function _OpenSSLDie
21>TFCLd.lib(rsa_sign.obj) : error LNK2001: unresolved external symbol __imp____iob_func
The project builds in VS2008 but with above error in VS2015. May I know what am I missing.
Put this in the begin of your class header file or in stdafx.h
FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
Have a look at:
http://openssl.6102.n7.nabble.com/Compiling-OpenSSl-Project-with-Visual-Studio-2015-td59416.html
Changing line 310 of the file e_os.h in the openssl root directory from# if _MSC_VER> =1300
to # if _MSC_VER> =1300 && _MSC_VER <= 1800
fixes the problem.
The original poster describes the cause of the problem:
In the Visual Studio 2015 the libraries with old names were redesigned
Visual Studio 2015 is referred to as _MSC_VER == 1900.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With