-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
hpsocket和qt操作sqlite不兼容吗? #250
Comments
需要补充一下,我是用的是x86-static |
这个问题好像是HPSocket使用malloc和系统的冲突了,需要禁用 |
能说下具体操作吗?十分感谢。 |
目前暂时的解决办法就是使用hpsocket.dll放弃lib。 |
项目属性 -> 链接 -> 输入,去掉 mimalloc,或者改为 jemalloc 试试。 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
我才用vcpkg安装的qt5-base,测试工程代码如下:
`#pragma once
#include <QtWidgets/QMainWindow>
#include "ui_qtwidgetsapplication3.h"
#include "SocketInterface.h"
#include "HPSocket.h"
class QtWidgetsApplication3 : public QMainWindow ,public CTcpServerListener
{
Q_OBJECT
public:
QtWidgetsApplication3(QWidget *parent = nullptr);
~QtWidgetsApplication3();
private:
#include "qtwidgetsapplication3.h"
virtual EnHandleResult OnPrepareListen(ITcpServer* pSender, SOCKET soListen);
virtual EnHandleResult OnAccept(ITcpServer* pSender, CONNID dwConnID, UINT_PTR soClient);
virtual EnHandleResult OnSend(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
virtual EnHandleResult OnReceive(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
virtual EnHandleResult OnClose(ITcpServer* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode);
virtual EnHandleResult OnShutdown(ITcpServer* pSender);
private:
Ui::QtWidgetsApplication3Class ui;
CTcpPackServerPtr m_Server;
};
#include
#include
#include
#include
QtWidgetsApplication3::QtWidgetsApplication3(QWidget *parent)
: QMainWindow(parent), m_Server(this)
{
ui.setupUi(this);
}
QtWidgetsApplication3::~QtWidgetsApplication3()
{}
EnHandleResult QtWidgetsApplication3::OnPrepareListen(ITcpServer * pSender, SOCKET soListen)
{
return EnHandleResult();
}
EnHandleResult QtWidgetsApplication3::OnAccept(ITcpServer* pSender, CONNID dwConnID, UINT_PTR soClient)
{
return EnHandleResult();
}
EnHandleResult QtWidgetsApplication3::OnSend(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength)
{
return EnHandleResult();
}
EnHandleResult QtWidgetsApplication3::OnReceive(ITcpServer* pSender, CONNID dwConnID, const BYTE* pData, int iLength)
{
return EnHandleResult();
}
EnHandleResult QtWidgetsApplication3::OnClose(ITcpServer* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode)
{
return EnHandleResult();
}
EnHandleResult QtWidgetsApplication3::OnShutdown(ITcpServer* pSender)
{
return EnHandleResult();
}
`
这会在db.open的时候导致程序崩溃。
The text was updated successfully, but these errors were encountered: