【发布时间】:2019-08-20 18:58:27
【问题描述】:
此错误仅在我更新 Xcode(以及 MacOS Mojave 10.14)后出现。 #include <Python> 也发生了类似的事情,我改用 #include "python2.7/Python.h" 来修复它。
Clang doesn't see basic headers 中讨论了类似的错误。当我尝试
clang++ -stdlib=libc++ PyTrans.cpp -o -v
我明白了
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation).
完整的错误:
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
/Users/joe/Documents/Research/EkpPyTransportDist/PyTransport/PyTrans/PyTrans.cpp:20:10: fatal error: 'iostream' file not found
include <iostream>
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
任何帮助将不胜感激;我对 C++ 很陌生。
编辑:括号内的间距。
【问题讨论】:
-
去掉包含中的空格。让它
#include <iostream>它实际上是在寻找一个“iostream”文件,意思是iostream前后都有一个空格。 -
在 include 指令中包含空格是错误的。
标签: c++ include iostream clang++ xcode10