From 9db5dd15c263490dfac227a4991eb872af380730 Mon Sep 17 00:00:00 2001 From: gitlost Date: Wed, 17 Jun 2020 20:46:18 +0100 Subject: [PATCH] Windows: #196 Visual Studio 2017 Zint Studio instructions --- backend_qt/backend_qt_zintdll.pro | 13 +++++++ frontend_qt/frontend_qt_zintdll.pro | 55 ++++++++++++++++++++++++++ win32/README | 60 ++++++++++++++++++++++++----- win32/libzint.vcxproj | 8 ++-- win32/zint.vcxproj | 3 -- 5 files changed, 123 insertions(+), 16 deletions(-) create mode 100644 backend_qt/backend_qt_zintdll.pro create mode 100644 frontend_qt/frontend_qt_zintdll.pro diff --git a/backend_qt/backend_qt_zintdll.pro b/backend_qt/backend_qt_zintdll.pro new file mode 100644 index 00000000..8f506df4 --- /dev/null +++ b/backend_qt/backend_qt_zintdll.pro @@ -0,0 +1,13 @@ +TEMPLATE = lib + +CONFIG += staticlib + +TARGET = QtZintDLL + +INCLUDEPATH += ../backend + +LIBS += -L"../win32/Release" -lzint + +HEADERS += qzint.h + +SOURCES += qzint.cpp diff --git a/frontend_qt/frontend_qt_zintdll.pro b/frontend_qt/frontend_qt_zintdll.pro new file mode 100644 index 00000000..6daf6320 --- /dev/null +++ b/frontend_qt/frontend_qt_zintdll.pro @@ -0,0 +1,55 @@ +TEMPLATE = app +TARGET = qtZint +QT += uitools +QT += widgets + +# Input +HEADERS += barcodeitem.h \ + datawindow.h \ + exportwindow.h \ + mainwindow.h \ + sequencewindow.h + +FORMS += extData.ui \ + extExport.ui \ + extSequence.ui \ + grpAztec.ui \ + grpC11.ui \ + grpC128.ui \ + grpC16k.ui \ + grpC39.ui \ + grpC49.ui \ + grpChannel.ui \ + grpCodabar.ui \ + grpCodablockF.ui \ + grpCodeOne.ui \ + grpDBExtend.ui \ + grpDM.ui \ + grpDotCode.ui \ + grpGrid.ui \ + grpHX.ui \ + grpLOGMARS.ui \ + grpMaxicode.ui \ + grpMicroPDF.ui \ + grpMQR.ui \ + grpMSICheck.ui \ + grpPDF417.ui \ + grpQR.ui \ + grpRMQR.ui \ + grpVIN.ui \ + mainWindow.ui + +SOURCES += barcodeitem.cpp \ + datawindow.cpp \ + exportwindow.cpp \ + main.cpp \ + mainwindow.cpp \ + sequencewindow.cpp + +RESOURCES += resources.qrc + +INCLUDEPATH += ../backend_qt ../backend + +LIBS += -lQtZintDLL -lzint +QMAKE_LIBDIR += ../backend_qt/release +QMAKE_LIBDIR += ../win32/Release diff --git a/win32/README b/win32/README index ca50101a..7adad14d 100644 --- a/win32/README +++ b/win32/README @@ -1,7 +1,8 @@ -Visual Studio 2017 - library and zint.exe ------------------------------------------ +Visual Studio 2017 +------------------ -To build the zint library DLL and the command line tool "zint.exe" with PNG support: +To build the zint library DLL and the command line tool "zint.exe" with PNG +support for x86/Win32: Install git (https://git-scm.com/downloads) Install cmake (https://cmake.org/download/) @@ -11,8 +12,8 @@ Open a "Developer Command Prompt for VS 2017" (should be available under the Make sure git and cmake are in your PATH, e.g. (your paths may differ) - set PATH="C:\Program Files\Git\cmd";%PATH% - set PATH="C:\Program Files\CMake\bin";%PATH% + set "PATH=C:\Program Files\Git\cmd;%PATH%" + set "PATH=C:\Program Files\CMake\bin;%PATH%" Download zint, zlib and libpng by going to the directory you want to clone them into: @@ -51,13 +52,51 @@ and then lpng: cd .. If you now open "\zint\win32\zint.sln" with Visual Studio -2017, you should be able to build both the Release and Debug configurations. +2017, you should be able to build the Release configuration for Win32. +"zint.dll" and "zint.exe" will be in "\zint\win32\Release". -Visual Studio 2017 - qtZint.exe -------------------------------- +To build Zint Studio ("qtZint.exe"), you need to have Qt installed, which +involves signing up for a Qt account and installing the Qt Maintenance Tool. +Using this tool you can install various versions of Qt and various optional +components. -TODO +The following requires the "MSVC 2017 32-bit" component to be installed. + +As of writing Qt 5.14.2 is the latest release that includes this component and +is used here. Add the location of this component to your PATH, e.g. (your path +may differ): + + set "PATH=C:\Qt\5.14.2\msvc2017\bin;%PATH%" + +Next build the zint backend Qt library: + + cd zint\backend_qt + + qmake backend_qt_zintdll.pro + nmake clean + nmake release + + cd ..\.. + +Then "qtZint.exe": + + cd zint\frontend_qt + + qmake frontend_qt_zintdll.pro + nmake clean + nmake release + + cd ..\.. + +This creates "\zint\frontend_qt\release\qtZint.exe". It +requires the zint DLL to run, so add its location to your PATH: + + set "PATH=\zint\win32\Release;%PATH%" + +You should now be able to run Zint Studio: + + zint\frontend_qt\release\qtZint Visual Studio 2015 @@ -68,6 +107,9 @@ sub-directory vs2015 and are no longer maintained. However by copying the steps above and adapting the settings from the Visual Studio 2017 project files (and adding any sources missing), they should be pretty serviceable. +For information on building a standalone version of Zint Studio using Visual +Studio 2015, see "frontend_qt/howto_build_qzint_using_msvs2015.txt" + Visual C++ 6 ------------ diff --git a/win32/libzint.vcxproj b/win32/libzint.vcxproj index 45408ac4..8cc5b6e3 100644 --- a/win32/libzint.vcxproj +++ b/win32/libzint.vcxproj @@ -78,9 +78,9 @@ libpng16_static.lib;zlib.lib;%(AdditionalDependencies) - $(OutDir)zintd.dll - ..\..\lpng\Build\Release;..\..\zlib;%(AdditionalLibraryDirectories) - libcmtd.lib;%(IgnoreSpecificDefaultLibraries) + $(OutDir)zint.dll + ..\..\lpng\build\Release;..\..\zlib;%(AdditionalLibraryDirectories) + libcmtd.lib;msvcrt.lib;%(IgnoreSpecificDefaultLibraries) true Windows MachineX86 @@ -113,7 +113,7 @@ libpng16_static.lib;zlib.lib;%(AdditionalDependencies) $(OutDir)zint.dll - ..\..\lpng\Build\Release;..\..\zlib;%(AdditionalLibraryDirectories) + ..\..\lpng\build\Release;..\..\zlib;%(AdditionalLibraryDirectories) false Windows true diff --git a/win32/zint.vcxproj b/win32/zint.vcxproj index 31c34c64..e0b7afd5 100644 --- a/win32/zint.vcxproj +++ b/win32/zint.vcxproj @@ -82,9 +82,6 @@ Level3 - - d:\opt\lib;%(AdditionalLibraryDirectories) -