컴파일 할 때 한 가지 문제가 있습니다.스레드에서 실행되는 C++ POCO 문제
다음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);
감사 :
여기In member function 'void CSConnection::onReadable(const Poco::AutoPtr&)':| CSConnection.cpp|92|error: no matching function for call to 'Poco::ThreadPool::start(QuitHandler*)'| CSConnection.cpp|92|note: candidates are:| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|122|note: void Poco::ThreadPool::start(Poco::Runnable&)| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|122|note: no known conversion for argument 1 from 'QuitHandler*' to 'Poco::Runnable&'| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|127|note: void Poco::ThreadPool::start(Poco::Runnable&, const string&)| c:\mingw\bin..\lib\gcc\mingw32\4.7.2........\include\Poco\ThreadPool.h|127|note: candidate expects 2 arguments, 1 provided| ||=== Build finished: 1 errors, 0 warnings (0 minutes, 1 seconds) ===|
이 quithandler 클래스 :
나는 오류 받아 봐!
지금 내가이 오류가 발생했습니다 'QuitHandler QH'의 초기화를 교차 | –
이 오류를 설명하는 최소 예를 게시하십시오. 또는 "교차 초기화"의 의미에 대한 설명을 읽으면 아마 스스로를 찾을 수 있습니다. http://stackoverflow.com/questions/2392655/what-are-the-signs-of-crosses-initialization. – BartoszKP
{}의 스위치가이를 수정했지만 스레드 시작, 실행 함수가 호출되지 않으면 응용 프로그램이 충돌합니다. –