From 84a010e6454ff641df894333a5a60c50f1f85c1b Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Thu, 11 Jun 2020 22:02:17 +0300 Subject: Windows (MSVC) build fixes --- src/certificateselectiondialog.cpp | 2 +- src/documentstyle.cpp | 1 + src/kristall.pro | 10 +++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/certificateselectiondialog.cpp b/src/certificateselectiondialog.cpp index 6c4a1f0..280b5db 100644 --- a/src/certificateselectiondialog.cpp +++ b/src/certificateselectiondialog.cpp @@ -68,7 +68,7 @@ void CertificateSelectionDialog::acceptTemporaryWithTimeout(QDateTime timeout) std::default_random_engine rng; rng.seed(QDateTime::currentDateTime().toMSecsSinceEpoch()); - std::uniform_int_distribution distr; + std::uniform_int_distribution distr(0, 255); char items[8]; for(auto & c : items) { diff --git a/src/documentstyle.cpp b/src/documentstyle.cpp index 50a4168..e8a4751 100644 --- a/src/documentstyle.cpp +++ b/src/documentstyle.cpp @@ -7,6 +7,7 @@ #include #include +#include #include static QString encodeCssFont (const QFont& refFont) diff --git a/src/kristall.pro b/src/kristall.pro index 73f2892..a8c7d03 100644 --- a/src/kristall.pro +++ b/src/kristall.pro @@ -15,10 +15,14 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 -QMAKE_CFLAGS += -Wno-unused-parameter -QMAKE_CXXFLAGS += -Wno-unused-parameter - LIBS += -lcrypto +win32-msvc { + QMAKE_CFLAGS += /permissive- + QMAKE_CXXFLAGS += /permissive- + LIBS -= -lcrypto + LIBS += "C:\Program Files\OpenSSL\lib\libcrypto.lib" + INCLUDEPATH += "C:\Program Files\OpenSSL\include" +} INCLUDEPATH += $$PWD/../lib/luis-l-gist/ DEPENDPATH += $$PWD/../lib/luis-l-gist/ -- cgit v1.2.3 From f0f4eb568bf71b8cb88e9fe99ac10209672063b4 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Thu, 11 Jun 2020 22:06:17 +0300 Subject: Keep -no-unused-parameter on non-MSVC --- src/kristall.pro | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kristall.pro b/src/kristall.pro index a8c7d03..8c98a4b 100644 --- a/src/kristall.pro +++ b/src/kristall.pro @@ -16,7 +16,13 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 LIBS += -lcrypto +QMAKE_CFLAGS += -Wno-unused-parameter +QMAKE_CXXFLAGS += -Wno-unused-parameter + win32-msvc { + QMAKE_CFLAGS -= -Wno-unused-parameter + QMAKE_CXXFLAGS -= -Wno-unused-parameter + QMAKE_CFLAGS += /permissive- QMAKE_CXXFLAGS += /permissive- LIBS -= -lcrypto -- cgit v1.2.3 From e6d08bad34c4408436599477c3ba79aacc6fad0c Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Thu, 11 Jun 2020 22:16:57 +0300 Subject: Added OpenSSL build instructions for windows --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e033db3..e36568d 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,17 @@ make #### Windows -Just use QtCreator to build `./src/kristall.pro`. Default settings should be fine. +Compile OpenSSL with the following steps: +- Install [Perl](https://www.perl.org/get.html) (either ActiveState or Strawberry) +- Install [NASM](https://www.nasm.us/) +- Add both to your PATH +- Clone [OpenSSL](https://github.com/openssl/openssl) +- Open a Visual Studio Developer Command Prompt (or a command prompt that has ran vcvarsall.bat). You will need Administrator privileges for the install step +- In the OpenSSL root directory, run `perl Configure VC-WIN32` if compiling for 32 bit, `perl Configure VC-WIN64A` for 64 bit +- Run `nmake` +- Run `nmake install` to install OpenSSL in `C:\Program Files\OpenSSL` + +Use QtCreator to build `./src/kristall.pro` with default settings. #### MacOS X -- cgit v1.2.3