我想在我的程序中使用 openssl 库,但是当我尝试包含它们时,我收到一条错误消息:“请更新您的 includePath”
我已经使用brew安装了openssl,并使用以下命令将openssl路径链接到/ usr / local / include目录:
ln -s /usr/local/opt/openssl/include/openssl /usr/local/include
仍然给出相同的错误。
编辑:请原谅我缺乏知识。我会尽力说得清楚。它是在 Visual Studio 代码中。我没有更新其中的包含路径(我真的不知道这意味着什么)。 这是一个智能感知错误。
当我开始用这一行编写程序时:
#include <openssl/sha.h>
我收到一个智能感知错误:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit
以下是在 VS Code 中更新 includePath 的步骤:
打开命令面板:按 Ctrl+Shift+P 并键入 C/C++: 编辑配置 (UI) 以打开配置 UI。
编辑包含路径:在配置 UI 中,找到包含路径部分。您应该添加 OpenSSL 标头的路径,即 /usr/local/opt/openssl/include。
手动编辑c_cpp_properties.json:或者,您可以手动编辑c_cpp_properties.json 文件。请按照以下步骤操作:
---在 VS Code 中打开项目文件夹。 ---在资源管理器视图中,导航到 .vscode/c_cpp_properties.json。如果 文件不存在,您可以创建它。 ---将 OpenSSL 标头的路径添加到 includePath 数组中。