/root/network/tcpserver.cpp:13: error: no matching function for call to 'TcpServer::connect(QTcpServer*&, void (QTcpServer::*)(), TcpServer* const, void (TcpServer::*)())'
时间: 2024-04-28 16:22:18 浏览: 27
这个错误提示是因为 connect 函数的第四个参数类型不正确,应该是指向 TcpServer 类中的成员函数指针。
请检查一下你传递给 connect 函数的第四个参数,确保它是指向 TcpServer 类中已经定义的成员函数的指针,并且函数指针的类型与参数列表和返回值类型完全匹配。如果你的代码中存在拼写错误或者函数参数不匹配等问题,也可能导致这个错误。
如果你无法解决这个问题,请提供更多的代码和上下文信息,以便更好地帮助你解决问题。
相关问题
connect(tcpsever,&QTcpServer::newConnection,this,&TcpServer::newconnet);报错/root/network/tcpserver.cpp:13: error: no matching function for call to 'TcpServer::connect(QTcpServer*&, void (QTcpServer::)(), TcpServer const, void (TcpServer::*)())'
这个错误提示是因为 connect 函数的第三个参数传递的是一个 const 对象,导致无法匹配正确的成员函数指针。
请将 connect 函数的第三个参数修改为指向非 const 的 TcpServer 对象指针,例如:
```
connect(tcpsever, &QTcpServer::newConnection, this, &TcpServer::newconnet);
```
注意,这里的第三个参数应该是指向非 const 的 TcpServer 对象指针 `this`,不能加上 const 限定符。
bootable/recovery/recovery.cpp:789:6: error: no matching function for call to 'fwrite'
这错误的原因是在代码中调用了`fwrite`函数,但是没有提供正确的参数。`fwrite`函数的参数应该是:
```
fwrite(const void *ptr, size_t size, size_t count, FILE *stream)
```
你需要确认调用`fwrite`时传入了正确的参数,特别是`count`参数,它表示要写入的元素的数量,而不是字节数量。如果这些参数都正确,但仍然出现错误,请检查文件指针`stream`是否正确初始化,指向了正确的文件。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)