Incomplete type error when using boost :: enable_shared_from_this

In the next line

class Symbol : public boost::enable_shared_from_this<Symbol> {

I get an error message:

error: invalid use of incomplete type struct boost::enable_shared_from_this<Symbol> / usr / include / boost / smart _ptr / shared_ptr.hpp: 63: error: declaration of struct boost::enable_shared_from_this<Symbol>

Any idea why I am getting this error. Symbol is an abstract class (if that matters)

+6
source share
1 answer

Opps. The error was that I did not include the header that enable_shared_from_this defines (this is boost / enable_shared_from_this.hpp).

It was only declared in / usr / include / boost / smart_ptr / shared_ptr.hpp

+10
source

Source: https://habr.com/ru/post/915252/


All Articles