2020-06-18 07:46:18 +12:00
|
|
|
Visual Studio 2017
|
|
|
|
------------------
|
2020-06-17 05:10:44 +12:00
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
To build the Zint library DLL and the command line tool "zint.exe" with PNG
|
2020-06-18 07:46:18 +12:00
|
|
|
support for x86/Win32:
|
2020-06-17 05:10:44 +12:00
|
|
|
|
|
|
|
Install git (https://git-scm.com/downloads)
|
|
|
|
Install cmake (https://cmake.org/download/)
|
|
|
|
|
|
|
|
Open a "Developer Command Prompt for VS 2017" (should be available under the
|
|
|
|
"Visual Studio 2017" tab in the Start menu).
|
|
|
|
|
|
|
|
Make sure git and cmake are in your PATH, e.g. (your paths may differ)
|
|
|
|
|
2020-06-18 07:46:18 +12:00
|
|
|
set "PATH=C:\Program Files\Git\cmd;%PATH%"
|
|
|
|
set "PATH=C:\Program Files\CMake\bin;%PATH%"
|
2020-06-17 05:10:44 +12:00
|
|
|
|
|
|
|
Download zint, zlib and libpng by going to the directory you want to clone them
|
|
|
|
into:
|
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
set "PROJECT_DIR=<project-directory>"
|
|
|
|
cd %PROJECT_DIR%
|
2020-06-17 05:10:44 +12:00
|
|
|
|
|
|
|
and cloning each:
|
|
|
|
|
|
|
|
git clone https://git.code.sf.net/p/zint/code zint
|
|
|
|
git clone https://git.code.sf.net/p/libpng/code lpng
|
|
|
|
git clone https://github.com/madler/zlib.git zlib
|
|
|
|
|
|
|
|
First build zlib:
|
|
|
|
|
|
|
|
cd zlib
|
|
|
|
|
|
|
|
nmake -f win32\Makefile.msc LOC="-DASMV -DASMINF=" OBJA="inffas32.obj match686.obj"
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
and then lpng:
|
|
|
|
|
|
|
|
cd lpng
|
|
|
|
|
|
|
|
cmake -G"Visual Studio 15 2017"^
|
|
|
|
-DCMAKE_BUILD_TYPE=Release^
|
|
|
|
-DPNG_BUILD_ZLIB=ON^
|
|
|
|
-DZLIB_INCLUDE_DIRS=..\zlib^
|
|
|
|
-DPNG_STATIC=ON^
|
|
|
|
-DPNG_SHARED=OFF^
|
|
|
|
-H.^
|
|
|
|
-Bbuild
|
|
|
|
|
|
|
|
cmake --build build --config Release
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
If you now open "%PROJECT_DIR%\zint\win32\zint.sln" with Visual Studio 2017, you
|
|
|
|
should be able to build the Release configuration for Win32.
|
2020-06-17 05:10:44 +12:00
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
"zint.dll" and "zint.exe" will be in "zint\win32\Release".
|
2020-06-17 05:10:44 +12:00
|
|
|
|
2020-06-18 07:46:18 +12:00
|
|
|
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.
|
2020-06-19 02:51:57 +12:00
|
|
|
(https://www.qt.io/download-qt-installer)
|
2020-06-18 07:46:18 +12:00
|
|
|
Using this tool you can install various versions of Qt and various optional
|
|
|
|
components.
|
2020-06-17 05:10:44 +12:00
|
|
|
|
2020-06-18 07:46:18 +12:00
|
|
|
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%"
|
|
|
|
|
2020-11-25 11:22:12 +13:00
|
|
|
Then build Zint Studio "qtZint.exe":
|
2020-06-18 07:46:18 +12:00
|
|
|
|
|
|
|
cd zint\frontend_qt
|
|
|
|
|
|
|
|
qmake frontend_qt_zintdll.pro
|
|
|
|
nmake clean
|
|
|
|
nmake release
|
|
|
|
|
|
|
|
cd ..\..
|
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
This creates "zint\frontend_qt\release\qtZint.exe". It requires the Zint DLL to
|
|
|
|
run, so add its location to your PATH:
|
2020-06-18 07:46:18 +12:00
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
set "PATH=%PROJECT_DIR%\zint\win32\Release;%PATH%"
|
2020-06-18 07:46:18 +12:00
|
|
|
|
|
|
|
You should now be able to run Zint Studio:
|
|
|
|
|
|
|
|
zint\frontend_qt\release\qtZint
|
2020-06-17 05:10:44 +12:00
|
|
|
|
|
|
|
|
|
|
|
Visual Studio 2015
|
|
|
|
------------------
|
|
|
|
|
|
|
|
The solution and project files for Visual Studio 2015 have been moved to the
|
|
|
|
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.
|
|
|
|
|
2020-06-18 07:46:18 +12:00
|
|
|
For information on building a standalone version of Zint Studio using Visual
|
|
|
|
Studio 2015, see "frontend_qt/howto_build_qzint_using_msvs2015.txt"
|
|
|
|
|
2020-06-17 05:10:44 +12:00
|
|
|
|
|
|
|
Visual C++ 6
|
|
|
|
------------
|
|
|
|
|
|
|
|
See "win32\zint_cmdline_vc6\readme.txt"
|
|
|
|
|
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
MinGW/MSYS
|
2020-06-17 05:10:44 +12:00
|
|
|
----------
|
|
|
|
|
2020-06-19 02:51:57 +12:00
|
|
|
If not already installed, download and run the MinGW Installation Manager setup
|
|
|
|
(https://osdn.net/projects/mingw/downloads/68260/mingw-get-setup.exe/) and
|
|
|
|
using it install the packages:
|
|
|
|
|
|
|
|
mingw-developer-toolkit-bin
|
|
|
|
mingw32-base-bin
|
|
|
|
mingw32-gcc-g++-bin
|
|
|
|
msys-base-bin
|
|
|
|
|
|
|
|
(This should include mingw32-libz-dll)
|
|
|
|
|
|
|
|
Any reasonably modern version of Qt can be used. The following uses Qt 5.14.2.
|
|
|
|
Using the Qt Maintenance Tool (see the Visual Studio 2017 instructions above)
|
|
|
|
install the "MinGW 7.3.0 32-bit" component.
|
|
|
|
|
|
|
|
(Note the Qt MinGW version does not necessarily have to match the version of
|
|
|
|
MinGW installed, but the closer the better).
|
|
|
|
|
|
|
|
Open a MinGW/MSYS shell by clicking/running e.g. (your path may differ)
|
|
|
|
|
|
|
|
C:\MinGW\msys\1.0\msys.bat
|
|
|
|
|
|
|
|
As above make sure git and cmake are in your PATH.
|
|
|
|
|
|
|
|
Add the Qt MinGW 7.3.0 32-bit component to your PATH, e.g. (your path may
|
|
|
|
differ):
|
|
|
|
|
|
|
|
export PATH="/c/Qt/5.14.2/mingw73_32/bin":${PATH}
|
|
|
|
|
|
|
|
Go into the directory you want to use and clone zint and libpng:
|
|
|
|
|
|
|
|
PROJECT_DIR="<project-directory>"
|
|
|
|
cd ${PROJECT_DIR}
|
|
|
|
|
|
|
|
git clone https://git.code.sf.net/p/zint/code zint
|
|
|
|
git clone https://git.code.sf.net/p/libpng/code lpng
|
|
|
|
|
|
|
|
To compile lpng on MSYS, a bit of fiddling is needed. Go to the directory:
|
|
|
|
|
|
|
|
cd lpng
|
|
|
|
|
|
|
|
On Windows git usually converts UNIX line endings to DOS ones. Undo this:
|
|
|
|
|
|
|
|
dos2unix * scripts/*
|
|
|
|
|
|
|
|
Attempt to do the usual GNU make:
|
|
|
|
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
|
|
|
|
This will fail with a syntax error. To fix:
|
|
|
|
|
|
|
|
sed -i 's/\r//' pnglibconf.h
|
|
|
|
|
|
|
|
And then do the make again:
|
|
|
|
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
The lpng includes should be in "/usr/local/include". Tell gcc to search there by
|
|
|
|
setting C_INCLUDE_PATH:
|
|
|
|
|
|
|
|
export C_INCLUDE_PATH=/usr/local/include
|
|
|
|
|
|
|
|
Now we should be able to build zint normally, except for telling cmake to
|
|
|
|
generate MSYS compatible makefiles:
|
|
|
|
|
|
|
|
cd zint
|
|
|
|
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -G "MSYS Makefiles" ..
|
|
|
|
make
|
|
|
|
|
|
|
|
cd ../..
|
|
|
|
|
|
|
|
This creates:
|
|
|
|
|
|
|
|
zint/build/backend/libzint.dll
|
|
|
|
zint/build/frontend/zint.exe
|
|
|
|
zint/build/frontend_qt/zint-qt.exe
|
|
|
|
|
2020-11-25 11:22:12 +13:00
|
|
|
The Zint command line tool "zint.exe" and Zint Studio "zint-qt.exe" need
|
|
|
|
"libzint.dll" to run so add its location to your PATH:
|
2020-06-19 02:51:57 +12:00
|
|
|
|
|
|
|
export PATH="${PROJECT_DIR}/zint/build/backend":${PATH}
|
|
|
|
|
2020-11-25 11:22:12 +13:00
|
|
|
You should now be able to run the command line tool:
|
2020-06-19 02:51:57 +12:00
|
|
|
|
2020-11-25 11:22:12 +13:00
|
|
|
zint/build/frontend/zint
|
2020-06-19 02:51:57 +12:00
|
|
|
|
2020-11-25 11:22:12 +13:00
|
|
|
And Zint Studio:
|
2020-06-19 02:51:57 +12:00
|
|
|
|
|
|
|
zint/build/frontend_qt/zint-qt
|