gpt4 book ai didi

c++ - 迁移到 Xcode,现在有很多 "is not member of std"和一些其他 header 问题

转载 作者:太空宇宙 更新时间:2023-11-04 12:24:46 25 4
gpt4 key购买 nike

我正在迁移到 OS X,现在尝试使用 Xcode。有一个项目在 g++ linux 发行版上正常编译和运行,现在在 mac 上它返回一千个错误。我猜想 linux std 文件以某种方式包含了其他需要的文件,现在它们在 Mac OS X 的 std 中没有连接。我怎么知道我做错了什么,就像这里一样:

/Users/Jonathan/Development/C++/Josk/Var.h:257:0 No match for 'operator<<' in 'out << ((Josk::Var*)Jv)->Josk::Var::ToString()' in /Users/Jonathan/Development/C++/Josk/Var.h

代码是:

friend ostream& operator << (ostream &out, Josk::Var &Jv){
out << Jv.ToString();
return out;
}

我不知道要在这里添加什么来解决这个问题,这是实际的包括:

#include <iostream>
#include <ostream>
#include <typeinfo>
#include <map>
#include <utility>
#include <algorithm>

谢谢!
乔纳森

最佳答案

看起来你不见了#include <string> .

关于c++ - 迁移到 Xcode,现在有很多 "is not member of std"和一些其他 header 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3122619/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com