qt 取位置 0x0000000000000008 时发生访问冲突。

0x00007FF85BA1810A (Qt5Networkd.dll) (AutoPackSystem.exe 中)处有未经处理的异常: 0xC0000005: 读取位置 0x0000000000000008 时发生访问冲突。

tcpServer执行初始化

void TcpServer::InitTcpServer()
{
    tcpServer = new QTcpServer(this);
    QString ip = GetLocalIP();
    if (ip.isEmpty())
    {
        QMessageBox::about(this, tr("提示"), tr("没有获取到本机的IP"));
    }
    else
    {
        // ui->lineEdit_Local_IP->setText(ip);
        qDebug() << "本机IP:" << ip;
    }
    connect(tcpServer, SIGNAL(newConnection()), this, SLOT(slot_newConnectionClient()));
}

 

posted @ 2025-03-31 10:48  txwtech  阅读(58)  评论(0)    收藏  举报