chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.88k stars 5.18k forks source link

: ‘Buffer’ is not a member of ‘muduo::net’? #552

Closed sychen12345 closed 2 years ago

sychen12345 commented 2 years ago

陈硕大佬,请问一下, using namespace muduo; using namespace muduo::net; muduo::net::Buffer buf; // Buffer buf; muduo::StringPiece s("buf\n");

    buf->append(s);

我这样使用muduo的buffer好像你书上也是这样写的,为什么会报错呢 error: ‘Buffer’ is not a member of ‘muduo::net’ muduo::net::Buffer *buf;

     muduo::net::Buffer *buf;
chenshuo commented 2 years ago

Did you

#include "muduo/net/Buffer.h"

?