升级到Xcode 10.1后如何修复"fatal error: 'iostream' file not found"
How to fix "fatal error: 'iostream' file not found" after upgrading to Xcode 10.1
这个错误只是在更新Xcode(以及MacOS Mojave 10.14(后才出现。类似的事情也发生在#include <Python>
,我改用 #include"python2.7/Python.h"来修复。
在 Clang 看不到基本标头中讨论了类似的错误。当我尝试时
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++很陌生。
编辑:括号内的间距。
如果您仔细阅读错误消息,您将看到它显示"在命令行上传递-std=libc++
"。如果你重新阅读你实际写的东西,它说-stdlib=libc++
.删除您那里的额外lib
,它应该可以正常工作。
此外,正如其他人对您的帖子的评论一样,您应该删除包含指令中的空格:#include <iostream>
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- 是否可以用"iostream"包装现有的TCP/OOpenSSL会话
- 在没有Xcode的情况下在Mac捆绑包中嵌入框架
- 需要从 istream 和 ostream 派生 iostream
- std::带有自定义缓冲区的 iostream 不允许我写入
- Xcode 语义问题引用或以前定义的代码
- 使用 Xcode 将双精度存储在数组C++中
- Xcode 9.4.1 中的 Apple Mach-O 链接器 (id) 错误
- 新的放置取决于 iostream
- 包含在 <initializer_list> <iostream>?
- 为什么在包含iostream时可以使用printf()?
- 各种版本的 Mac OSX 向后兼容性如何?(Xcode C++
- MacOS 上的 Xcode 11 项目不在一个函数中使用 sin 和 cos:未定义的符号"___sincosf_stret"
- macOS 是内置在 clang 编译器中还是内置于 xcode ide 中?
- Xcode 11.1:找不到 iostream 的文件
- 找不到'iostream'文件 Xcode
- 升级到Xcode 10.1后如何修复"fatal error: 'iostream' file not found"
- 为什么 Xcode 4 在每个标头中都包含 iostream
- 在 Xcode 中,当我包含 <iostream>时,似乎 stdlib.h 也被包含。为什么?
- 如何强制xcode使用正确的iostream头文件