Chr*_*ker 4 c++ visual-studio-2017
我尝试在 VS2017 (C++) 中编译应用程序,但出现错误:
1>libeay32.lib(cryptlib.obj) : error LNK2001: unresolved external symbol ___iob_func
1>libeay32.lib(pem_lib.obj) : error LNK2001: unresolved external symbol ___iob_func
1>libeay32.lib(ui_openssl.obj) : error LNK2001: unresolved external symbol ___iob_func
Run Code Online (Sandbox Code Playgroud)
报告此类错误的其他帖子适用于 VS2015,请参阅stdin, stdout和stderr。但这些修复对我来说没有用。
奇怪的是,如果我在代码中转到 stdin 并(右键单击)转到定义,它会将我带到 Visual Studio 11.0 包含目录,而不是 VS2017 的目录。
我的错误是在libeay32.lib中,我在任何地方都找不到 C++ 源代码。
还有其他人遇到过这个问题吗?
小智 5
我找到了这个解决方案并将这些行添加到我的 VS 17 C++ 项目中
#define stdin (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))
FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }
This worked for me.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11109 次 |
| 最近记录: |