不允许使用不完整的类型

时间:2022-03-12 02:11:04

1.定义对象之前,编译器必须看到完整的类定义,你的代码std::fstream out("person.pb", ios::out | ios::binary | ios::trunc); 中的std::fstream只是声明了,还没有定义,需要包含头文件。