首页 > 解决方案 > /usr/local/include/string.h:25:10:致命错误:找不到“plist/Node.h”文件

问题描述

我试图在 MacOS 中用 C++ 运行一个 hello world 程序。尝试使用终端使用命令运行它g++ -o test.cpp test

它给了我上述错误。我是否需要以某种方式重新安装我的编译器,如果是,那么我该怎么做?

clang++ 和 g++ 和 gcc。我已经设置了xcode。

xcode-select --install当我在某处阅读时,我也安装了。

我已经尝试了所有这些来运行程序。他们有这样的版本

clang++ -v

Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

g++ -v

Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

标签: c++gccg++clangclang++

解决方案


该 g++ 命令是拼写错误还是您尝试将输出文件设置为 test.cpp?你是如何安装 g++ 的?

这是你得到的唯一错误吗?

/usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found

如果你跑步会发生什么

g++ -o test -Wall test.cpp

推荐阅读