【问题标题】:/usr/local/include/string.h:25:10: fatal error: 'plist/Node.h' file not found/usr/local/include/string.h:25:10:致命错误:找不到“plist/Node.h”文件
【发布时间】:2019-07-13 13:12:45
【问题描述】:

我试图在 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++ gcc g++ clang clang++


【解决方案1】:

那个 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

【讨论】:

  • 它仍然给出同样的错误。像这样安装 g++ edparrish.net/common/macgpp.php
  • 你的代码只是一个简单的hello world?你只包括iostream?当您不提供代码时,很难提供帮助
  • #include 使用命名空间标准; int main() { cout
  • 包括
猜你喜欢
  • 2013-12-05
  • 2014-10-19
  • 1970-01-01
  • 2019-04-01
  • 2020-03-08
  • 1970-01-01
  • 1970-01-01
  • 2020-09-23
  • 1970-01-01
相关资源
最近更新 更多