gpt4 book ai didi

c++ - 错误 LNK2001 : unresolved external symbol ___iob_func in VS2017

转载 作者:行者123 更新时间:2023-11-30 03:23:22 26 4
gpt4 key购买 nike

我正在尝试在 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

报告此类错误的其他帖子是针对 VS2015 的,引用 stdin、stdoutstderr。但这些修复对我不起作用。

奇怪的是,如果我转到代码中的标准输入并(右键单击)转到定义,它会将我带到 Visual Studio 11.0 包含目录,而不是 VS2017 目录。

我的错误是在 libeay32.lib 中,我在任何地方都找不到 C++ 源代码。

有没有人遇到过这个问题?

最佳答案

我找到了这个解决方案并将这些行添加到我的 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.

关于c++ - 错误 LNK2001 : unresolved external symbol ___iob_func in VS2017,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50411270/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com