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的原因。