在下一行
class Symbol : public boost::enable_shared_from_this<Symbol> {
我得到错误:
错误:不完整类型的无效使用struct boost::enable_shared_from_this<Symbol>
/usr/include/boost/smart_ptr/shared_ptr.hpp:63: 错误:声明 struct boost::enable_shared_from_this<Symbol>
知道为什么我会收到此错误。 Symbol 是一个抽象类(如果重要的话)
最佳答案
哎呀。错误是因为我没有包含 定义 enable_shared_from_this 的 header (这是 boost/enable_shared_from_this.hpp)。
它只是在/usr/include/boost/smart_ptr/shared_ptr.hpp 中声明
关于c++ - 使用 boost::enable_shared_from_this 时出现不完整的类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10509726/