Incomplete type is not allowed: stringstream

前端 未结 3 1826
花落未央
花落未央 2020-12-13 05:18

Why does this line give the error Error: incomplete type is not allowed?

stringstream ss;
3条回答
  •  天涯浪人
    2020-12-13 06:05

    Some of the system headers provide a forward declaration of std::stringstream without the definition. This makes it an 'incomplete type'. To fix that you need to include the definition, which is provided in the header:

    #include 
    

提交回复
热议问题