【发布时间】:2020-04-11 21:07:48
【问题描述】:
我刚刚开始学习如何编程。我在我的 Mac 和 C/C++ 扩展上设置了 VSCode。我从 Stroustrup 的 Programming and Principles 书中编写了 helloworld 程序。我将 std_lib_facilities.h 文件放在与 helloworld.cpp 文件相同的文件夹中。我仍然收到错误消息:#include 检测到错误。请更新您的 includePath。此翻译单元已禁用 Squiggles。
为什么我仍然收到错误消息?这本书说我需要的只是将 std_lib_facilities.h.txt 文件与我的 .cpp 程序放在同一目录中。它们在同一个文件夹中,为什么会出现此错误?
我的代码:
#include "std_lib_facilites.h"
int main()
{
cout << "Hello World \n";
return 0;
}
【问题讨论】:
-
这能回答你的问题吗? Is c++ std_lib_facilities.h still used?
-
谢谢,我现在为获取文本文件所做的只是输入:#include "full directory path",即:#include "Users/Venkat/project/helloworld/std_lib_facilites.h"
-
感谢 Gino,从您链接的问题中的一个答案/cmets 中得知,我必须下载新版本的 std_lib_facilities 文件,结果我必须在 .txt 之后编写 .txt。 h也是!