我在编译时遇到了一个问题。
我收到错误:
在成员函数 'void CSConnection::onReadable(const Poco::AutoPtr&)':| CSConnection.cpp|92|错误:没有匹配的函数调用 'Poco::ThreadPool::start(QuitHandler* )'| CSConnection.cpp|92|注意:候选人是:| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|122|注意:void Poco::ThreadPool::start(Poco: :可运行&)| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|122|注意:'QuitHandler 中的参数 1 没有已知的转换*' 到 'Poco::Runnable&'| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|127|注意:void Poco::ThreadPool::start(Poco: :Runnable&, 常量字符串&)| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|127|注意:候选人需要 2 个参数,提供 1 个| ||=== 构建完成:1 个错误,0 个警告(0 分钟,1 秒)===|
这是 quithandler 类:
class QuitHandler : public Runnable
{
public:
QuitHandler(){}
CSConnection * _con;
void run();
virtual ~QuitHandler();
protected:
private:
char * _packet;
};
这里错误行
QuitHandler * qh;
qh = new QuitHandler();
WorkerThreadPool::getInstance().tp->start(qh);
谢谢!