我在另一个 IDE 上运行了这段代码,它成功了。出于某种原因,我在 Xcode 上收到上述错误消息。我想我错过了某种标题,但我不确定是哪一个。
#include <iostream>
#include <limits>
#include <string>
#include <vector>
int main() {
vector<string> listRestaurants; // error: Implicit instantiation of undefined template
return 0;
}
原文由 Nathan Hale 发布,翻译遵循 CC BY-SA 4.0 许可协议
Xcode 10.2.1 向我显示错误
Implicit instantiation of undefined template 'std::__1::vector<std::__1::basic_string<char>, std::__1::allocator<std::__1::basic_string<char> > >'
。修复了我的问题。