[fix] Fixed Windows build

Former-commit-id: 4e142e3e01
This commit is contained in:
Leroy.H.Y 2019-12-09 22:16:29 +08:00
parent c1ff048d01
commit d8fe9259d2
6 changed files with 11 additions and 9 deletions

View File

@ -15,7 +15,7 @@ jobs:
run: git submodule update --init
# --------------------------------------------------------
- name: Installing Qt
uses: jurplel/install-qt-action@v2
uses: lhy0403/install-qt-action@v2
with:
arch: win64_mingw73
modules: qtcharts
@ -68,7 +68,7 @@ jobs:
run: git submodule update --init
# --------------------------------------------------------
- name: Installing Qt
uses: jurplel/install-qt-action@v2
uses: lhy0403/install-qt-action@v2
with:
modules: qtcharts
# --------------------------------------------------------
@ -113,7 +113,7 @@ jobs:
run: git submodule update --init
# --------------------------------------------------------
- name: Installing Qt
uses: jurplel/install-qt-action@v2
uses: lhy0403/install-qt-action@v2
with:
modules: qtcharts
# --------------------------------------------------------

View File

@ -1 +1 @@
1678
1687

View File

@ -189,8 +189,8 @@ win32 {
message(" --> Linking against gRPC and protobuf library.")
LIBS += -L$$PWD/libs/gRPC-win32/lib/ -llibgrpc++.dll -llibprotobuf.dll
message(" --> Linking against winHTTP.")
LIBS += -lwinhttp -lwininet
message(" --> Linking against winHTTP and winSock2.")
LIBS += -lwinhttp -lwininet -lws2_32
INCLUDEPATH += $$PWD/libs/gRPC-win32/include
DEPENDPATH += $$PWD/libs/gRPC-win32/include

View File

@ -39,7 +39,11 @@ namespace Qv2ray
int errcode;
if ((errcode = resolveHost(data.hostName.toStdString(), data.port, &resolved)) != 0) {
#if defined (__WIN32) && defined (UNICODE)
data.errorMessage = QString::fromStdWString(gai_strerror(errcode));
#else
data.errorMessage = QSTRING(gai_strerror(errcode));
#endif
return data;
}

View File

@ -2,9 +2,7 @@
#ifdef _WIN32
#include <winsock2.h>
#include <winsock.h>
#include <ws2def.h>
#include <windows.h>
#include <ws2tcpip.h>
#else
#include <sys/socket.h>

View File

@ -329,9 +329,9 @@ int main(int argc, char *argv[])
LOG(MODULE_INIT " " MODULE_UI, "Setting Qv2ray UI themes: " + confObject.uiConfig.theme)
}
#endif
// Show MainWindow
MainWindow w;
#endif
#ifndef QT_DEBUG
try {