main.cpp: In function 'bool ReadTimeInterval(std::string&)':
main.cpp:134: error: variable 'std::ifstream ifs' has initializer but incomplete type
main.cpp:139: warning: deprecated conversion from string constant to 'char*'
main.cpp:139: warning: cannot pass objects of non-POD type 'const struct std::string' through '...'; call will abort at runtime

出现这个错误,是由于没有添加头文件:

添加 #include <fstream>

总结:这里看到了gcc的提示,incomlete type不完全的类型。

一般这种题目是因为缺乏头文件引起的,经常会碰到如许子的提示,所以记住产生incomplete type的原因。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-10
  • 2021-05-26
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2022-12-23
相关资源
相似解决方案